Irving Oil Commercial GP of Canada was ordered by a New Brunswick court on Thursday to pay $4 million Canadian after it pleaded guilty to 34 violations of the country’s Transportation of Dangerous Goods Act, stemming from the Maine-based Montreal, Maine & Atlantic Railway Ltd. train derailment and explosion that killed 47 people in the town of Lac Mégantic, Quebec, on July 6, 2013.

The Saint John Provincial Court ordered Irving Oil to pay $400,000 in fines and $3.6 million for the implementation of transportation safety research programs, according to a Public Prosecution Service of Canada news release. The company also was ordered to submit a corrective measures plan with Transport Canada.

After the deadly 2013 incident, a joint investigation by Transport Canada and the Royal Canadian Mounted Police revealed that Irving Oil failed to comply with safety requirements regarding the classification of dangerous goods for the crude oil it transported by train, and that the shipping documents on board the train were erroneous. The company also failed to adequately train its employees in the transportation of dangerous goods, investigators said.