WASHINGTON  — The Supreme Court threw out an $18 million penalty Thursday against a natural gas company convicted of violating an environmental law.

The court voted 6-3 in favor of Texas-based Southern Union Co. in an appeal of a penalty imposed for its improper storage of mercury in a building in Pawtucket, R.I.