Federal regulators have given oil and gas operator Hilcorp until May 1 to permanently repair a pipeline spewing more than 200,000 cubic feet of gas a day into Alaska's Cook Inlet or shut it down, citing public safety and environmental risks. The line has been leaking since late December, the regulator disclosed, longer than reported by the company.

The directive by the U.S. Transportation Department's Pipeline and Hazardous Materials Safety Administration (PHMSA) requires Hilcorp to submit a repair plan and do a comprehensive safety inspection of the line. The proposed safety order, issued March 3, adds to mounting pressure on Hilcorp to fix a rupture some fear could lead to severe environmental damage. Cook Inlet is home to endangered beluga whales and other protected species.

"PHMSA finds that the continued operation of the Affected Pipeline Facility, without corrective measures, poses a pipeline integrity risk to public safety, property, and the environment," the letter said, explaining that "the leak could get worse and potentially fail."

Hilcorp did not respond to a request for comment. The company has said it cannot shut down the converted 8-inch oil pipeline without risking a rush of seawater into the pipe that could trigger a more dangerous leak of residual crude. Repair efforts are blocked by ice in the inlet.

The pipeline, built in 1965, carries natural gas 15 miles from land to four offshore oil platforms owned by Hilcorp. A parallel pipeline transports the crude oil.

Hilcorp reported the leak to PHMSA on Feb. 7, after bubbles were observed on the surface of the inlet. PHMSA, through its investigation, learned the company spotted a problem in late January when it noticed an increased flow of gas through the line. Hilcorp then began to survey the area by helicopter before it found the leak.

The company then discovered that the pipeline had been leaking since late December 2016. PHMSA requires companies to report leaks within 30 days or face fines.

"What that tells me is that they did not have good control of their system," said Lois Epstein, an engineer who is the Arctic program director for The Wilderness Society. "They didn't have leak detection, and they weren't even going over their numbers to catch it at the time."

The company slowed the flow of gas after discovering the leak, though enough is still flowing to power the platforms. It estimates that between 210,000 and 310,000 cubic feet of natural gas are leaking out every day.

The state Department of Environmental Conservation has ordered the company to submit a plan for monitoring the leak and its impact on wildlife. That plan is due Wednesday and will have to be approved by the department before it is implemented.

A group of seven environmental organizations led by the Center for Biological Diversity sent a letter Tuesday to top officials at the Department of Transportation and PHMSA urging them to shut down the pipeline.

"The leak also poses an imminent environmental hazard to Cook Inlet and its wildlife, including the critically endangered Cook Inlet beluga whale," wrote the group, which included the National Resources Defense Council and Greenpeace.

The belugas of Cook Inlet were listed as endangered under the Endangered Species Act in 2008. Three years later, the National Marine Fisheries Service designated some areas of the inlet—including the location of the gas leak—as critical habitat for the belugas under the Endangered Species Act. The inlet is also home to a population of steller sea lions that is endangered, as well as subsets of humpback whales, sea otters and eiders that are designated as threatened under the Endangered Species Act.

Environmentalists are concerned that the methane in the gas could displace oxygen in the water, causing hypoxic zones that could threaten the marine life there. The Center for Biological Diversity and the nonprofit Cook Inletkeeper have both filed notices of intent to sue if the leak is not stopped within 60 days.

This is not the first time this pipeline has leaked. In 2014, a year before Hilcorp purchased the pipeline from ExxonMobil subsidiary XTO Energy, two other leaks were discovered. Those were two-thirds of a mile from the current leak, according PHMSA, and were caused by rocks crashing into areas of the pipe that aren't flush with the seabed.

Cook Inlet isn't an easy place to operate. Upper Cook Inlet, where the pipeline sits, is known for extreme tides averaging 20 feet and surging as high as 35 feet, as well as currents in excess of 5 to 7 knots.

"Cook Inlet is a radical water body," said Bob Shavelson, advocacy director of Cook Inletkeeper. "You'll get a movement of water around a pipeline that turns the water into a sandblaster. It can erode the external coating a pipeline from the outside."

Companies with underwater pipelines in Cook Inlet typically monitor their pipes annually, PHMSA wrote. The goal is to identify segments not supported by the seabed that could be vulnerable and to provide extra pipeline supports when needed.

The challenges of operating pipelines in Cook Inlet have been well known since at least the 1970s, according to Epstein of The Wilderness Society.

But the annual inspection methods that Hilcorp uses—called side-scan sonar or multi-beam echo-sounder surveys—don't detect eroded pipe, dents, missing concrete coating or other defects that could weaken the pipeline, according to PHMSA. One of the requirements in the order is that Hilcorp send divers "or equivalent" to inspect vulnerable areas.

Houston-based Hilcorp uses a strategy called "acquire and exploit," meaning it buys oil and gas operations that are already producing in hopes of earning remaining profits. It has become the primary producer in Cook Inlet using this strategy. According to the Alaska Oil and Gas Conservation Commission, the company is responsible for 12 of the 45 safety violations from 1977 through 2016. The company began operating in Alaska in 2012.

Until the ice begins to melt, it's a waiting game. "It's really cold here right now. That sea ice is going to be sticking around for a while," said Shavelson.

Hilcorp told Alaska officials that it would need two to three consecutive days of conditions safe for diving to temporarily fix the pipeline. It would then take another five to seven days to permanently repair it.

"According to Hilcorp, the ice could clear as early as late March or as late as the end of April 2017," PHMSA said in its order.

"Because of sea ice, weather conditions, and the Cook Inlet's extreme tides and currents, diving operations cannot be safely conducted at present and, therefore, immediate repair of the leaking pipeline is not a viable option," it said.

Hilcorp has 30 days to contest the order, and PHMSA is expected to issue a final safety order after that period. Within two weeks of that order, Hilcorp will have to submit a pipeline leak inspection and repair plan for approval. It must also prepare a plan for safely terminating its gas delivery system if the pipeline has to be shut down.