TORONTO — Canadian National Railway Co. will phase out its fleet of 183 older tank rail cars used to transport diesel fuel over the next four years as it works to improve safety after a string of industry accidents involving the puncture-prone cars.

The company, Canada’s largest rail operator, said on Tuesday it will spend C$7 million by the end of this year to replace the 40 legacy DOT-111 tank cars that it owns with new cars that meet the latest regulatory standards.

Its remaining 143 leased DOT-111 cars will be replaced gradually as the leases mature over the next four years, the Montreal-based company said.

DOT-111 tank cars have a long history of puncturing in accidents, a problem that came into public focus after a runaway crude train crashed last summer in Lac-Megantic, Quebec, killing 47 people.

“For CN, tank car design is one of the most important systemic issues arising from the Lac-Megantic accident,” CN Chief Executive Officer Claude Mongeau said in a statement.

The development comes after CN and smaller rival Canadian Pacific Railway Ltd. increased rates for the older variety of DOT-111 tank cars earlier this year. CP said it was concerned about the cars’ use in transporting crude.

Mongeau told Reuters last week that CN increasingly was moving western Canadian crude, with the vast majority transported in coiled CPC 1232 tank cars.

The CPC 1232 design refers to a circular issued by the American Association of Railroads requiring all crude- and ethanol-carrying cars ordered after October 2011 to have enhanced safety features, including reinforced outer shells and protective shields.

CN said it delivers “99.998 percent of dangerous goods … without a release caused by an accident.”

As part of the push to improve the safety of dangerous goods transportation, CN also urged that mutual aid intervention protocols be put into effect.

With the participation of other carriers and producers of dangerous commodities, such protocols could help set emergency response standards and expand resources, it said on Tuesday.

The railway has launched a voluntary program to meet municipal officials and emergency responders to discuss the nature and volumes of dangerous commodities transported through their communities. Canadian railways are required to provide such information to municipalities annually.

The railway also has extended a U.S. policy on hazardous materials, the OT-55 key train policy, to its Canadian operations. The policy includes measures on train dispatch, track inspections and restrictions on train speeds.