OTTAWA -- The federal government is ordering the 5,000 most dangerous tank cars off the rails as it adopts the major rail safety recommendations of the Transportation Safety Board in the wake of the tragedy last summer in Lac Megantic.

Transport Minister Lisa Raitt says the immediate measures will take care of the most vulnerable of the older model tank cars, known as DOT-111, while those carrying crude oil and ethanol must be phased out or retrofitted within three years.

"We are immediately removing the least crash-resistant DOT-111 tank cars from dangerous goods service by directing the phase-out of tank cars that have no continuous reinforcement of their bottom shell in 30 days," Raitt said.

Rail carriers will also be required to prepare emergency response assistance plans for shipments of all petroleum products, including everything for crude oil to diesel.

Emergency response is to be improved across the country through a task force involving municipalities, first responders, railways and shippers.

"We are always committed to improving railway safety and the transportation of dangerous goods by rail," Raitt told a news conference.

She said there will be changes to insurance rules so that in the event of an accident there will be enough money available to cover compensation and cleanup costs.

"I also feel strongly that Canadians should not be expected to cover the costs of damages in the event of an accident."

The actions are the latest response to last summer's horrific derailment and fire in Lac Megantic that claimed 47 lives.

Concerns about the safety of DOT-111 tank cars date back at least 20 years.

The DOT-111 tank car is considered the workhorse of the North American fleet and makes up about 70 per cent of all tankers on the rails.

Safety experts have said the soda-can shaped car has a tendency to split open during derailments and other major accidents.

There's been intense political and public pressure to make oil trains safer since a runaway train with 72 tank cars of North Dakota oil derailed and exploded in Lac-Megantic. The train was left unattended by its lone crew member while parked near the town. The train came loose and sped downhill into Lac-Megantic. More than 60 tank cars derailed and caught fire, and several exploded, destroying much of the downtown.

Oil trains also have exploded and burned in Alabama, North Dakota and New Brunswick in recent months.

The oil industry has been increasingly using trains to transport oil in part because of a lack of pipelines.

U.S. freight railroads transported about 415,000 carloads of crude in 2013, up from just 9,500 in 2008, according to government and industry figures.

The oil trains, some of which are 100 cars long, pass through or near scores of cities and towns.

Some companies have said they will voluntarily take the DOT-111 tank cars offline. Irving Oil Ltd., a large Canadian refiner, has said it will stop using the older DOT-111s by April 30. Canada's two largest railways, Canadian National Railway and Canadian Pacific Railway, have already said they would move away from the DOT-111. But it is the oil companies or shippers that own or lease many of the cars.