WASHINGTON — The United States and Canada on Friday announced long-awaited safety rules for trains carrying oil, as regulators seek to reduce risks after a series of explosive accidents that accompanied a surge in crude-by-rail shipments.

The rules call for a rapid phase out of older tank cars considered unsafe during derailments, and are more aggressive than even some of the toughest proposals yet put forward. The rail and energy sectors have already expressed concern that the required speed of the phase outs is not feasible and the potentially billions of dollars in costs will be too high for the small safety improvements they deliver.

Under the rules, announced by Canada’s Minister of Transport, Lisa Raitt and U.S. Transportation Secretary Anthony Foxx, tank cars built before October 2011 known as DOT-111 will be phased out within three years. DOT-111 tank cars, until now the workhorse of the oil by rail fleet, are considered prone to puncture during accidents, increasing the risk of fire and explosions.

Tank cars built after October 2011 meeting more updated standards, known as CPC-1232, without reinforced hulls will be phased out by 2020, three years faster than rules proposed in Canada earlier this year that were already considered stringent.

“This stronger, safer, more robust tank car will protect communities on both sides of our shared border,” said Canada’s Raitt.

The tougher standards come nearly two years after a train carrying crude oil came off the rails in the Canadian town of Lac Megantic in July 2013, exploding and killing 47 people. Since then, a series of fiery accidents involving crude trains have occurred in rural areas across North America.

Republican U.S. Sen. Susan Collins said in a statement Friday that Foxx had called her this morning about the new regulations, which she said “appear to move in the right direction and should help prevent future tragedies.”

Independent U.S. Sen Angus King praised the announcement.

“Communities all across the country – from Maine to West Virginia to California – have experienced the destruction wreaked by the derailment of rail cars and the outdated regulations governing them,” King said. “No one ought to feel like their towns and communities are in danger every time a train runs through.”

Oil shipments by rail largely stopped in Maine after the Lac-Megantic disaster in July 2013. Some shipments came through the state in March 2014. There were no such shipments for one year after that, with about 37,128 barrels coming through Maine in March 2015, mostly headed for the J.D. Irving refinery in St. John, New Brunswick.

The rules have already created a fierce debate between tank-car owners, railroads and federal regulators. New tank cars must have thicker hulls, head shields to protect the end of each car, electronic pneumatic brakes and pressure-relief valves, all of which have been deemed by regulators to be crucial in improving the safety of transporting oil by rail.

Oil trains will be restricted to a maximum of 50 miles per hour.

The suite of new regulations is expected to cost an estimated $2.5 billion to implement over the next two decades, two thirds of that to retrofit or retire existing tank cars, according to cost estimated in the rules. The benefits could range from $912 million up to $2.9 billion, they said.

The required electronically controlled pneumatic (ECP) brakes trigger all axles simultaneously rather than one at a time in current design, which safety advocates have said is an important advance.

“Until very recently, the industry consensus was that ECP braking would not likely be a part of the ruling as the technology is not in high volume production and would add significant cost to the train and the rail cars,” said Taylor Robinson, president of PLG Consulting, which provides guidance to companies on crude rail shipments.

“The industry will have to work hard to find solutions that meet the rules in the most cost effective manner,” Robinson said.

The oil industry is concerned that a demand for a 9/16th-inch steel tanker frame will make the existing tanker car obsolete, since upgrades would be too costly.

Charles Drevna, the president of the American Fuel & Petrochemical Manufacturers, a leading voice for the refining industry, said a five-year phase out of existing tank cars — a timetable endorsed by the U.S. National Transportation Safety Board — was unrealistic.

Share of companies that manufacture railcars and equipment for railroad freight, such as Greenbrier Co, Trinity Industries Inc, Westinghouse Air Brake Technologies Corp , and American Railcar Industries Inc jumped several percent after the announcement.

Additional reporting by Randall Palmer, Jarrett Renshaw and Chuck Mikolajczak.