WASHINGTON - The Supreme Court ruled Thursday that sewage plants and other industries cannot avoid environmental requirements under landmark clean-water protections when they send dirty water on an indirect route to rivers, oceans and other navigable waterways.

Rejecting the Trump administration’s views, the justices held by a 6-3 vote that the discharge of polluted water into the ground, rather than directly into nearby waterways, does not relieve an industry of complying with the Clean Water Act.

“We hold that the statute requires a permit when there is a direct discharge from a point source into navigable waters or when there is the functional equivalent of a direct discharge,” Justice Stephen Breyer wrote for the court.

The decision came in a closely watched case from Hawaii about whether a sewage treatment plant needs a federal permit when it sends wastewater deep underground, instead of discharging the treated flow directly into the Pacific Ocean. Studies have found the wastewater soon reaches the ocean and has damaged a coral reef near a Maui beach.

The Environmental Protection Agency under President Donald Trump reversed the agency’s position that Breyer noted has appeared to work well for more than 30 years.

Justices Samuel Alito, Neil Gorsuch and Clarence Thomas dissented.

Sewage plants and other polluters must get a permit under the Clean Water Act when pollutants go through a pipe from their source to a body of water. The question in this case was whether a permit is needed when the pollutant first passes through the soil or groundwater.

Maui injects 3 million to 5 million gallons a day of treated wastewater into wells beneath the Lahaina Wastewater Reclamation Facility, which sits about a half-mile from the Pacific shoreline. Environmental groups in Hawaii sued Maui after studies using dyes to trace the flow showed more than half the discharge from two wells was entering the ocean in a narrow area. They won a ruling from the federal appeals court based in San Francisco.

Breyer raised concerns during arguments in November that a ruling for Maui would provide a “road map” for polluters to evade federal permit requirements.

Still, the court did not go as far as the federal appeals court, which adopted a standard that would have brought even more groundwater discharges under the clean water law.