A California company that operated a natural gas storage system that leaked last year, spewing thousands of tons of methane and other chemicals into the air and forcing the evacuation of more than 6,000 people, reached a $4 million settlement with state prosecutors, officials announced on Tuesday.

The company, Southern California Gas Company, pleaded no contest to a misdemeanor of failing to immediately report the Oct. 23, 2015, gas leak to the California Office of Emergency Services and to the local Certified Unified Program Agency. As part of the plea, the company will be ordered to pay $30...