Massachusetts has enough underground gas lines to stretch from Boston to Tokyo three times, and nearly a quarter are made from outdated materials.

“We are trying to repair leak-prone pipes in the ground,” said state Rep. John Keenan, D-Salem, who co-chairs the Joint Committee on Telecommunications, Utilities and Energy. “We have some of oldest infrastructure in the country, along with Philadelphia and New York.”

The recent explosion in Harlem that leveled two buildings and killed eight people provides a chilling example of why aging infrastructure must be modernized, Keenan said. He and state Sen. Ben Downing, D-Pittsfield, have sponsored a bill designed to accelerate gas line repairs and set uniform repair standards throughout Massachusetts.

The bill, he said, includes a funding mechanism that would allow utility companies to front-load the cost of repairs. It would also streamline the process for utilities to go before the state regulatory board to get approval for expedited repairs.

Of the 21,000 miles of underground mains in Massachusetts, more than 17 percent is made of outdated cast iron, and 7.9 percent is bare steel, according to the Pipeline & Hazardous Materials Safety Administration. Plastic and coated steel, which are less brittle and less prone to corrosion, are the industry’s current materials of choice.

Many of the older underground mains date to the years following World War II.

“When the pipes were put in the ground, the basic inventory consisted of cast iron and bare steel,” Columbia Gas spokeswoman Sheila Doiron said. “That vintage of material was expected to last 60, 70, 80 years. If you do the math, it’s really time to replace that vintage of underground infrastructure, because it’s nearing the end of its useful life.”

Among 11 utility companies, there were 17,292 reported gas leaks statewide in 2012, the most recent year for which the Department of Public Utilities was able to provide a complete data set. Of those, 15,477 were repaired by the end of the year. Most of the leaks were minor.

“Our underground systems are safe and function as they should,” National Grid spokesman Jake Navarro said. “They meet the range of regulatory requirements. The state of our system is strong. On the other hand, we are always working to improve it.”

National Grid, which accounts for nearly half the gas mains in the state, had 7,258 reported leaks in 2012, of which 7,119 were repaired by year’s end, according to the Department of Public Utilities.

With nearly 11,000 miles of gas mains in Massachusetts, National Grid spent $290 million on gas infrastructure in the state last year and plans to invest an additional $1.8 billion over the next five years, Navarro said. The utility replaced 160 miles of gas mains in Massachusetts in 2013, work that typically consisted of replacing cast iron or bare steel mains with plastic.

Page 2 of 2 - NStar, which has nearly 3,200 miles of gas mains statewide, replaced approximately 25 miles last year at a cost of $38 million, which is in addition to the $35 million it spent on maintenance and operations, company spokesman Michael Durand said.

“Natural-gas safety has always been and will always be our top priority,” he said. “That’s why we’re committed to replacing pipes and why we support the legislation.”

NStar had 2,531 leaks in 2012 and repaired 3,290 during the year, according to the Department of Public Utilities.

Columbia Gas had 5,922 leaks in 2012 and repaired 3,646 that year, according to the DPU.

Gas leaks, Doiron explained, are assigned categories depending on their severity. Grade 1 leaks, which pose the most serious threat, must be repaired immediately. Grade 2 leaks, she said, do not pose an imminent danger and must be repaired within 12 months. Leaks in the least serious category, Grade 3, do not pose any danger to life or property, she said.

At the end of last quarter, Columbia had no pending Grade 1 leaks, 668 Grade 2 leaks and approximately 4,400 Grade 3 leaks, down from 6,100 at the beginning of the quarter, Doiron said.

“That’s pretty typical in the gas industry to have that many,” she said.

Of Columbia Gas’s nearly 5,000 miles of underground mains in Massachusetts, it classifies approximately 1,000 miles as “priority pipes” targeted for expedited replacement, Doiron said. The utility is currently in the midst of a multiyear effort to replace its priority mains.

Last year, between replacing mains and adding new ones, Columbia Gas invested $100 million in Massachusetts, Doiron said.

“Of that, about $40 million was to replace pipes,” she said. “We replaced about 45 miles last year.”

Gerry Tuoti is the regional newsbank editor for GateHouse Media New England.