A train carrying tanker cars of ethanol and empty vehicle-shipping racks derailed Saturday morning about two miles north of the small Wisconsin river town of Alma, across the border from Wabasha, Minn.

The cause of the derailment, which caused a temporary and voluntary evacuation of nearby residents, is under investigation, according to a statement from BNSF railroad released Sunday morning.

According to BNSF, company crews stopped the leaks from five tank cars that were breached in the accident, they placed a containment boom along the shoreline of the river, and began removing ethanol from the tanker cars. Four tank cars each released an estimated 5 to 500 gallons of ethanol. A fifth tank car released an estimated 18,000 gallons. BNSF is continuing to monitor for environmental impacts and to work on scene with the multiple federal and state agencies involved, the company statement said.

The Buffalo County Sheriff's Office said that 32 cars derailed about 8:45 a.m. and temporarily closed two state highways. Emergency crews and BNSF Railway personnel were dispatched to the scene along with Federal Railroad Administration investigators.

BNSF spokeswoman Amy McBeth said there were no injuries or signs of explosion.

"BNSF will work with the EPA and state agencies on the best plan for mitigation and remediation efforts," McBeth said in a statement Saturday. There was no early speculation on a cause.

Photos posted on social media showed numerous overturned cars off the tracks that run alongside the Mississippi. The sheriff's office had not issued any reports of leaking chemicals.

Authorities at the scene said highways were reopened in the early afternoon and that any evacuated residents were free to return to their homes. The rail tracks are expected to be cleared and reopened to service Monday morning, BNSF said.

A command center was set up at a school in Alma, and the town's American Legion hall was opened to shelter any evacuees, the sheriff's office said.