A blowout at a natural gas well that gushed uncontrollably for 16 weeks and drove thousands of residents from their Los Angeles homes was plugged Thursday, a utility said.

While the well still needs to be permanently sealed with cement and inspected by state regulators, the announcement by Southern California Gas Co. marked the first time the leak has been under control since it was reported Oct. 23.

"We have temporarily controlled the natural gas flow from the leaking well and begun the process of sealing the well and permanently stopping the leak," Jimmie Cho, a SoCalGas senior vice president, said in a statement.

The leak is expected to cost the company, a division of Sempra Energy, at least $250 million, according to a filing with the Securities and Exchange Commission.

That figure could climb much higher because it only accounts for costs of capping the well and relocating about 6,400 families. It does not include potential damages from more than two dozen lawsuits, penalties from government agencies and expenses to mitigate pollution.

If the plug holds and all goes according to plan to seal the well, the upscale Porter Ranch community in the San Fernando Valley could begin to return to normalcy after schools were closed and about 6,000 families were uprooted as they complained of headaches, nausea, nosebleeds and other symptoms as an intermittent stench wafted through the area.

Public health officials blamed their woes on an odorant added to gas so it can be detected and have said they don't expect long-term health impacts.

Vicky Walker, who lives close to the facility, said the smell was particularly strong the past few nights but wasn't noticeable Thursday afternoon.

She spent three to four nights a week in a hotel after developing a cough, but returned regularly to work from her home office. But she gained five pounds as she stayed inside as much as possible and stopped walking her dog.

"I want to get back to life as I knew it as soon as possible," Walker said. "And I hope property values don't suffer."

The leak at the largest underground gas storage reservoir in the West was declared an emergency by the governor. At its peak, the leak was estimated to contribute about a quarter of the state's climate-altering methane emissions, leading some to call it the worst environmental disaster since the 2010 BP oil spill in the Gulf of Mexico.

While the gas was invisible, its impact could be seen in half-vacant subdivisions, two shuttered schools and on the faces of angry residents who packed public meetings and community forums and demanded the Aliso Canyon storage facility be shut down.

The blowout happened in a 60-year-old well that was built to pump oil from porous rock a mile-and-a-half below the Santa Susana Mountains. After the oil ran dry in the 1970s, the field of 115 wells was reused to store natural gas.

When demand and prices were low, gas was injected at high pressure in the ground. It was piped out during cold months or to fuel gas-run electricity plants during energy spikes.

Regulators will use high-tech equipment to survey the ruptured pipe for clues about what went wrong before cement is poured into the well to permanently cap it.

Residents who voluntarily moved out will have at least a week to return to their homes after inspectors certify it is safe.

SoCalGas has paid to relocate residents in hotels, apartments and houses. Hotel dwellers will have eight days to return home and those who moved to other accommodations can stay through the end of short-term leases they signed.

In recent weeks, many people have gone home as the rate of the leak dwindled and air filters were installed in their homes.

Once the well is sealed, though, life for some may never return to normal. The incident has focused attention on the aging facility and the state is investigating the impact if it were shut down to figure out how Southern California would replace a major source of energy.

Some folks have said they don't want to move back, and many are concerned about what the incident has done to the value of their homes. The company is facing more than two dozen lawsuits, some of which seek class-action status.