Prosecutors say they reached a $4 million settlement with a utility that had a massive gas leak that forced thousands of Los Angeles residents from their homes.

Los Angeles County District Attorney Jackie Lacey said Tuesday that the settlement requires Southern California Gas Co. to adopt expensive safety measures at its Aliso Canyon facility that go beyond federal and state requirements.

The prosecutor says the company pleaded no contest to a misdemeanor count of failing to immediately report the gas leak to state officials when it was discovered Oct. 23.

The well leaked nearly four months and led more than 8,000 families to move out of their homes in the Porter Ranch area of the San Fernando Valley.

The settlement includes the maximum fine of $75,000, plus a penalty of $232,000.