BOSTON (AP) -- Massachusetts utility regulators slapped three power companies with penalties totaling nearly $25 million on Tuesday for their handling of widespread outages caused by two major storms in 2011.

The record fines against National Grid, NStar and Western Massachusetts Electric Co. were imposed after a lengthy investigation by the state into how the utilities planned for and responded to Tropical Storm Irene and a surprise October snowstorm. Hundreds of thousands of customers lost electricity and many waited longer than a week for the lights to come back on after each storm.

By far, the biggest penalty was assessed against National Grid, which was fined nearly $8.2 million for Irene and more than $10.5 million for the snowstorm -- a total of 18.7 million.

Ann Berwick, chairwoman of the Department of Public Utilities, cited "systematic and fundamental failures in how the company planned for and responded to both storms."

"We also found that many of the problems with National Grid's response have persisted for some time and the company had been warned about in the past," Berwick added.

Inadequate planning

The investigation revealed inadequate planning for the storms, as well as failures in responding to public safety threats posed by toppled electrical wires, she said. National Grid was also cited for lapses in communication with its customers and municipal officials after the storms, and for not prioritizing facilities such as nursing homes while restoring power.

National Grid said in a statement it was reviewing the decision and evaluating its options. The company can appeal to the state's highest court.

"We understand customers were frustrated by the outages resulting from the devastating storms in 2011 and we share that frustration," the company said, adding that it has implemented many changes in emergency planning that were put in practice during the more recent Superstorm Sandy.

NStar and Western Massachusetts Electric (WMECO), both divisions of Hartford, Conn.-based Northeast Utilities, said they would appeal the penalties.

NStar was fined $4.1 million -- $2.2 million for Irene and $1.9 million for the snowstorm. WMECO was fined $2 million, and only for its response to the snowstorm.

Official ‘disappointed'

Regulators said that while both companies met most standards for response, neither did an adequate job of clearing downed wires that posed a major safety hazard for police and firefighters along with the general public.

"We strongly disagree with the department and are disappointed that they dismissed the tireless effort put forth by our employees to respond to customers after these historic storms," said Werner Schweiger, NStar's president, in a statement announcing the company's intention to appeal.

Irene alone damaged 80 percent of the NStar's overhead circuits, Schweiger said, forcing the utility to essentially rebuild its power grid even as it was trying to restore electricity.

Peter Clarke, president of WMECO, said his company also strongly disagreed with the findings, saying it responded to the emergencies in a "safe, responsible and methodical way under extremely difficult conditions."

Berwick did praise the utilities for a stronger response to Sandy. That storm did not cause the same level of damage in Massachusetts as in several other northeastern states.