By Brent Kendall

WASHINGTON -- The Supreme Court removed a legal barrier to the construction of an $8 billion pipeline that would deliver natural gas from West Virginia, ruling the project could run under a major East Coast hiking trail.

The court, in a 7-2 opinion by Justice Clarence Thomas on Monday, overturned a lower-court ruling that found the U.S. Forest Service didn't have the authority to grant a special-use permit that allowed developers of the Atlantic Coast Pipeline to construct an underground segment beneath a section of the Appalachian National Scenic Trail in Virginia.

The Atlantic Coast Pipeline is a partnership in which Dominion Energy Inc. and Duke Energy Corp. are major investors. It would transport natural gas from West Virginia across 600 miles to sites in Virginia and North Carolina. The companies say the project is needed to help meet East Coast demand for cleaner-burning fuel. The pipeline was announced in 2014 but has faced delays, with the current price tag totaling about $8 billion.

Environmentalists argued the pipeline's path could harm ecologically important national forests, with threats of soil erosion and damage to wildlife habitat. They said the project would harm an especially picturesque section of the Appalachian Trail in Virginia located near Reed's Gap and the Wintergreen Resort. The trail runs more than 2,000 miles from Maine to Georgia.

Sign up for WSJ's free Capital Journal newsletter here.

Write to Brent Kendall at brent.kendall@wsj.com