Southern California Gas Co. and its parent company, Sempra Energy, will pay $1.8 billion to settle more than 35,000 claims brought by residents and businesses impacted by a 2015 gas leak.

Monday’s settlement, one of the largest environmental tort agreements in California, comes as both companies faced trial in the litigation, which alleges the leak at the Aliso Canyon Natural Gas Storage Facility near the Porter Ranch neighborhood of Los Angeles caused medical problems and damaged property.