A plume of thick black smoke could be seen many miles away and explosions were heard.
No injuries were reported, but officials are urging people from the nearby town of Casselton – some 2,300 people – to evacuate as a precaution.
An investigation into the incident has been launched.
A spokeswoman for the North Dakota Department of Emergency Services said the last 50 wagons of the train had been uncoupled, but another 56 remained at risk.
The derailment, after a collision involving another goods train, is reported to have happened near an ethanol plant.
Emergency and fire-fighting crews have been sent to the scene.
Cass County sheriff’s office said it was “strongly recommending” that residents in parts of Casselton and anyone living five miles to the south and east evacuate.
Officials have said a change in weather patterns could expose residents to smoke and possible health hazards.
Residents within 10 miles of the scene are being asked to stay indoors.
A shelter for those evacuated has been set up in Fargo, about 25 miles away.
Correspondents say it is the latest in a string of incidents that have raised alarm about a rise in crude oil traffic on the railways.
In July, a train carrying oil from the Bakken oil region in North Dakota derailed near the Canadian town of Lac Megantic, killing more than 40 people.
EFUAxRxeDuAThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…