CASSELTON, N.D. (AP) — Many residents evacuated a southeastern North Dakota town overnight after a train carrying crude oil derailed and exploded, and officials warned that acrid and hazardous smoke could blow into the area.

No one was hurt in Monday's derailment of the mile-long train that sent flames and great plumes of black smoke skyward about a mile from the small town of Casselton. The National Transportation Safety Board was preparing to investigate but the fire was such as darkness fell that investigators couldn't even get close enough to count the number of burning cars. Some burned through the night.

The Cass County Sheriff's Office called on the 2,400 people living in Casselton, about 25 miles west of Fargo, to leave their homes, citing a shift in winds.

"That's going to put the plume right over the top of Casselton," Sheriff Paul Laney said.

Early Tuesday Sheriff's Deputy Joe Crawford said about two-thirds of the town's residents had heeded the recommendation to evacuate their homes. Officials were waiting for daybreak before making new attempts to investigate the scene, Crawford said.

Terry Johnson, the manager of a grain dealer less than a mile from the derailment, said he heard at least six explosions in the two hours following the derailment.

"It shook our building and there was a huge fireball," he said.

Official estimates of the extent of the blaze varied. BNSF Railway Co. said it believed about 20 cars caught fire after its oil train left the tracks about 2:10 p.m. Monday. The sheriff's office said Monday it thought 10 cars were on fire. Officials said the cars would be allowed to burn out.

Authorities haven't yet been able to untangle exactly how the derailment happened. 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 both trains had more than 100 cars each.

The incident will likely prompt discussion about the safety of transporting oil by cross-country rail. Fears of catastrophic derailments were particularly stoked after last summer's crash in Quebec of a train carrying crude from North Dakota's Bakken oil patch. Forty-seven people died in the ensuing fire.

The National Transportation Safety Board said Monday night it has launched a "go-team" to investigate this latest derailment. Jeff Zent, a spokesman for Gov. Jack Dalrymple, said the National Guard was on alert if needed.

Ryan Toop, who lives about a half-mile away, said he heard the explosions and drove in below zero temperatures until he was the equivalent of about two city blocks from the fire.

"I rolled down the window, and you could literally keep your hands warm," Toop said.

The rail tracks run straight through Casselton, and Cass County Sheriff's Sgt. Tara Morris said it was "a blessing (the derailment) didn't happen within the city."

A shelter was set up in Fargo and Casselton Mayor Ed McConnell said he didn't want anyone sleeping in their vehicles as temperatures dipped to 20 below overnight.

"All the experts say it can be a hazardous situation to their health," McConnell said. "We're going to try to get everybody out of the town."

The North Dakota Department of Health warned that exposure to burning crude could cause shortness of breath, coughing and itching and watery eyes. It had said those in the vicinity with respiratory conditions such as asthma, bronchitis or emphysema should minimize outdoor activity.

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

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.

___

Associated Press writers James MacPherson in Bismarck, N.D., and Dirk Lammers in Sioux Falls, S.D., contributed.