Irving Oil has been ordered to pay $4 million after pleading guilty to 34 counts stemming from the 2013 rail disaster in Lac-Megantic.

The offences were committed over eight months, from November 2012 to July 2013 involving transportation of approximately 14,000 rail cars of crude oil for Irving Oil.

On July 6, 2013, a train carrying 7.7 million litres of crude oil sped toward the small Quebec town at 104 km/h before derailing, killing 47 people in the resulting fire and explosions.

The federal Public Prosecution Service said Thursday that a provincial court judge in Saint John, N.B., ordered Irving Oil to pay fines totalling $400,320.

It will also pay a contribution of nearly $3.6 million for the implementation of research programs in the field of safety standards under the Transportation of Dangerous Goods Act and its regulations.

Following the train derailment in Lac-Megantic, an investigation by Transport Canada and the RCMP revealed that Irving Oil had not complied with all applicable safety requirements by not classifying the crude oil being carried by train as a dangerous good.

In addition, the shipping documents on board the trains were incorrect.

The statement also says Irving Oil did not adequately train its employees in the transportation of dangerous goods, thereby committing an offence under the Act.