A federal judge barred the Trump administration Friday from approving oil companies’ requests to use the high-pressure drilling technique known as fracking in offshore wells along the Southern California coast until a review of the possible effects on endangered species and state coastal resources.

In lawsuits by the state and environmental groups, U.S. District Judge Philip Gutierrez of Los Angeles said federal agencies that issue underwater drilling permits must consult with the U.S. Fish and Wildlife Service, about the possible impact of fracking chemicals on sea birds and otters, before approving any permits for its use off Santa Barbara, Ventura and Los Angeles counties. He said the agencies must also present their plans to the California Coastal Commission, which reviews offshore projects for possible harms to coastal areas.

Fracking, or hydraulic fracturing, injects a high-pressure mixture of water and chemicals into rocks and mineral deposits to release oil and gas. Environmental advocates contend it causes water and air pollution and have urged Gov. Jerry Brown, unsuccessfully, to ban its use on California lands.

Oil companies say fracking is harmless, and it was permitted in federal lands and waters under President Barack Obama, when the lawsuits were filed. Besides offshore fracking, the suits challenge government approval of acidizing, the injection of acid into a well to increase oil production. The American Petroleum Institute and Exxon Mobil Corp. joined federal agencies in opposition to the suits.

Gutierrez’s ruling did not criticize the drilling techniques, and in fact upheld the government’s assessment — begun under Obama, completed under Trump — that concluded their continued use offshore would have “no significant impact” on the environment. But he said the permit-issuing agencies had failed to consult adequately with the Fish and Wildlife Service about threatened species, and had failed to consult at all with the Coastal Commission.

Any need by the government and oil companies to approve drilling permits with fracking or acidizing “is outweighed by the interest of the people of the state of California” in having their commission “review the proposed action for consistency with California’s coastal management plan,” Gutierrez said.

The ruling allows the commission to study the impact of offshore fracking on coastal lands, wildlife and water quality, and requires a public hearing, said attorney Linda Krop of the Environmental Defense Council, a plaintiff in the case. If the commission decides coastal resources were at risk, she said the federal government could still issue permits, but the commission could challenge them in court.

“If the Coastal Commission objects, in my experience the federal government has backed down,” Krop said. She said environmental organizations had to file Freedom of Information Act requests during the Obama administration to discover that the government had been quietly issuing permits for offshore fracking for years. No such permits have been issued in the last few years while the suits were pending, she said.

Another environmental lawyer, Kristen Monsall of the Center for Biological Diversity, said the ruling “protects marine life and coastal communities from fracking’s toxic chemicals.”

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @BobEgelko