PERRY, Oklahoma -- Railroad employees continue to work Friday to clean up from a freight train derailment in the community of Perry in Noble County. 

The derailment of the Burlington Northern Santa Fe train happened at around 10:30 p.m. Thursday, according to Perry Mayor Chuck Hall. 

Perry Fire Chief Wayne Emmons said he has now confirmed 13 cars derailed near the crossing at 7th Street.

Throughout the night, crews have been working to clean up a liquid that police said appears to be a liquid fertilizer that spilled out of one of the cars and haul away the debris. 

Perry police said crews treating the liquid as hazardous material. As a precaution, authorities in Perry evacuated families from three homes near the area where the train derailed. The families were given permission to go back to their homes Friday morning.

BNSF hired crews to clean up the substance. Now, crews are working to move all the cars off the tracks. The next step will be to repair the tracks so that other trains can pass through. Following the repairs, crews will work to put the derailed cars back on the tracks and haul them away.

BNSF spokesman Joe Faust expects to have everything back on the tracks and trains moving again by 7:30 p.m. Friday.

Faust said the cause of the derailment was not immediately known. He said the train was traveling approximately 20 miles per hour when it derailed.

Perry is located north and west of Stillwater.

The Associated Press contributed to this report.