Updated

A southeastern North Dakota town narrowly escaped tragedy when a train carrying crude oil derailed and exploded nearby, the mayor said Tuesday, calling for changes in how the fuel is transported across the United States.

No one was hurt in Monday's derailment of the mile-long train that sent a great fireball and plumes of black smoke skyward about a mile from the small town of Casselton. The fire had been so intense as darkness fell that investigators couldn't get close enough to count the number of burning cars.

Worries about the smoke plume prompted officials to ask Casselton's 2,400 residents to voluntarily evacuate Monday evening, and most did. The recommendation was lifted Tuesday afternoon, but officials were urging residents south of the derailment to remain vigilant about changing conditions, Cass County Commissioner Ken Pawluk said.

Residents said the blasts endured for hours after the derailment, shaking their homes and businesses. A BNSF spokeswoman said 18 tanker cars burned.

Pawluk estimated that the fire was about 80 to 90 percent burned out by Tuesday afternoon.

National Transportation Safety Board officials on the scene said the agency's investigation would examine the train recorder, the signal system, the condition of the train operators, train and tracks, as well as the response to the derailment.

Board member Robert Sumwalt said the tankers involved were DOT-111s, a model that has shown a tendency to rupture in other accidents, but he said it wasn't immediately clear if they were newer, safer DOT-111s or the older models.

The rail tracks run straight through the middle of Casselton, a town of 2,400 people about 25 miles west of Fargo. Mayor Ed McConnell estimated that dozens of people could have been killed if the derailments had happened within the town. He said it is time to "have a conversation" with federal lawmakers about the dangers of transporting oil by rail.

"There have been numerous derailments in this area," he told The Associated Press. "It's almost gotten to the point that it looks like not if we're going to have an accident, it's when. We dodged a bullet by having it out of town, but this is too close for comfort."

A train carrying crude from North Dakota's Bakken oil patch crashed in Quebec last summer, bursting into flames and killing 47 people.

Shipping oil by pipeline has to be a safer option, McConnell said Tuesday.

North Dakota is the No. 2 oil-producing state in the U.S., trailing only Texas. The state's top oil regulator said earlier this month that he expected as much as 90 percent of North Dakota's oil to be carried by train in 2014, up from 60 percent.

Ron Ness, president of the North Dakota Petroleum Council, called the derailment "extremely unfortunate."

"We're glad no one was hurt," said Ness, whose Bismarck-based group represents several hundred companies working in the state's oil patch. "I certainly think we'll see some continued efforts on safety to the rail system and rail cars."

North Dakota oil drillers increasingly use trains to ship crude to locations not served by pipelines, in part because of the difficulty in securing permits for the structures, Ness said.

"For every action, there is a reaction or counter-action," he said. "Getting any product to market from North Dakota always has been a challenge, whether it is oil, sugar beets or beef. And we have been able to find good markets because the rail industry has responded."

The number of crude oil carloads hauled by U.S. railroads surged from 10,840 in 2009 to a projected 400,000 this year. Despite the increase, the rate of accidents has stayed relatively steady. Railroads say 99.997 percent of hazardous materials shipments reach destinations safely.

Authorities haven't yet been able to untangle exactly what caused the derailment. BNSF spokeswoman Amy McBeth said another train carrying grain derailed first, and that this knocked several cars of the oil train off adjoining tracks.

BNSF said each train comprised more than 100 cars.