WASHINGTON - Rail tank cars used to transport crude oil and many other flammable liquids will have to be built to stronger standards to reduce the risk of a catastrophic train crash and fire, under sweeping new safety rules unveiled Friday by U.S. and Canadian transportation officials.

The regulations are a long-awaited response to a series of fiery train crashes in the U.S. and Canada, including four so far this year. The most serious accident occurred in July 2013, when a runaway oil train derailed in Lac-Megantic, Quebec, just across the border from Maine, killing 47 people and destroying most of the town's central business district.

"I witnessed firsthand, and I believe that we truly have to act to honor those who died and honor those who were injured" to show that safety is "our most important priority in transportation," said Canada's Minster of Transport, Lisa Raitt. She joined U.S. Transportation Secretary Anthony Foxx in announcing the new regulations.

Get Breaking News Delivered to Your Inbox

Under the rules, new tank cars carrying the most volatile liquids, including crude oil and ethanol, must have an outer shell, a thermal lining to withstand fire, improved top and bottom fittings and thicker, 9/16ths-inch steel walls to keep them from rupturing.

Thousands of older tank cars known as DOT-111s that are more prone to rupture will be the first to be phased out or retrofitted under a timetable ranging from three to 10 years. Some newer tank cars, called 1232s, that were built to a voluntary standard agreed to by the industry in 2011 must also be phased out or retrofitted.

Defending the timetable, Foxx said officials took into account how long it will take manufacturers to produce tank cars to the new standard.

"This is a schedule we believe is workable. It's aggressive," he said. "If you talk to some of the manufacturers who are going to have to do the work, it's more aggressive than they would like."

Trains of at least 70 cars that have at least one car containing the most volatile class of liquids also must have electronically controlled brakes that automatically stop all the cars in a train at the same time, instead of sequentially. The braking requirement goes into effect on Jan. 1, 2021. But it will be extended to all flammable-liquid trains after 2023.

The braking requirement applies only to the U.S., but Raitt said Canadian regulators are moving on a separate, faster track to adopt a new braking standard.

Officials estimated the cost of the regulations at $2.9 billion. The oil and railroad industries had lobbied heavily against some of the changes, including meetings several times in recent months with White House budget officials.

The American Petroleum Institute said Friday the timeline for tank car retrofits is too short and doesn't recognize limits on shop capacity available to get the work done. API President Jack Gerard said the regulations "will lead to shortages that impact consumers and the broader economy" by choking off the transport of oil to refineries.

Railroads had fought the new braking requirements, saying it will cost them billions of dollars for little or no added safety benefit. The Transportation Department "couldn't make a case" for electronic brakes "but forged ahead anyhow," said Edward R. Hamberger, the Association of American Railroad's CEO. "This is an imprudent decision made without supporting data or analysis."

But Sarah Feinberg, head of the Federal Railroad Administration, said electronic brakes will be "a game-changer" for safety. "We are not an agency with the goal of making things convenient or inexpensive for industry."

The two governments worked on the rules together because oil trains go back and forth across the border.

Last year, railroads moved a half-million tank cars of crude oil, up from just 9,500 in 2008 before the hydraulic fracturing boom made oil production surge in the Bakken region of North Dakota, Montana and Canada.

The Obama administration has been under intense pressure from Congress as well as from state and local officials to ensure the safety of oil trains that traverse the country after leaving the Bakken region. To get to refineries on the East and West Coasts and the Gulf of Mexico, oil shipments travel through more than 400 counties, including major metropolitan areas such as Philadelphia, Seattle, Chicago, Newark and dozens of other cities.

Government tests show Bakken crude is often more volatile than other crude oils.