LOS ANGELES — A blowout at a natural gas well that spewed massive amounts of climate-changing methane for nearly four months and drove thousands of Los Angeles families from their homes has been permanently sealed, state officials declared Thursday.

The announcement certifying that the ruptured well had been plugged with cement brought a point of closure in the long-running drama that has disrupted life in the Porter Ranch community and drawn attention to a massive underground storage facility owned by Southern California Gas Co.

Testing showed the well was no longer leaking, Jason Marshall, chief deputy director of the California Department of Conservation, said at a press conference.

Families in short-term housing — at hotels or staying with friends and relatives — will have eight days to return before the gas company stops reimbursements. Those who rented apartments and houses can stay through their leases as late as April 30.

Investigations now will begin into how the well had managed to blow out and leak uncontrollably for so long. It was drilled for oil in 1953 and reused for natural gas storage in the 1970s.

Inspections also will be done on other aging wells in the same field, and regulators are looking into what would happen to energy supplies if the Aliso Canyon facility — the largest in the West for gas storage — does not reopen.

Some residents angry or sickened by the leak want to see the storage area permanently closed. The leak was reported in October, and nearby residents complained of headaches, nausea, dizziness and nosebleeds.

The gas company, a division of Sempra Energy, said it expects expenses of as much as $300 million for temporarily lodging 6,400 households, plugging the leak and the loss of gas that gushed for 16 weeks.

The figure does not include potential damages from at least 67 lawsuits, penalties from government agencies and expenses to mitigate pollution, which the company noted could be significant.

Natural gas is odorless and invisible, but an additive used to make it detectable to the human nose blanketed neighborhoods at times with a nauseating stench.

Public health officials blamed the odorant for many of the symptoms residents complained about, though they said they don’t expect long-term illnesses from the gas, which is mostly methane, or trace elements such as cancer-causing benzene.

Air quality monitors set up during the leak will remain in place to make sure the air is clean to breathe.

Although the well has been declared sealed, Gov. Jerry Brown won’t immediately lift an emergency declaration he made last month.