A CSX Corp freight train carrying coal derailed while crossing an overpass west of Baltimore, killing two 19-year-old women and crushing several cars parked near the bridge, officials said on Tuesday.

Police received a call around midnight that an eastbound CSX train had come off the tracks in downtown Ellicott City, about 12 miles west of Baltimore, Howard County Police said in a statement.

Rescue workers discovered two bodies in the wreckage, police said. The victims were identified as Ellicott City residents Elizabeth Nass and Rose Mayr.

"Two young women tragically lost their lives in a train accident this morning near Ellicott City, Maryland. CSX wishes to offer its sincere condolences to their families," CSX spokesman Lauren Rueger said in a statement.

Nass was a student at Virginia's James Madison University, according to her Facebook page. Mayr was a student at the University of Delaware, according to her Facebook page.

Twenty-one of the train's 80 cars left the tracks in the accident, police said. Operators of the train's two locomotives were unharmed.

"Many of those train cars fell onto automobiles, literally fell onto automobiles with the coal, so you have massive piles of coal and heavy train cars on top of automobiles," Howard County Executive Ken Ulman told NBC News.

Photos of the scene posted to the Baltimore Sun website showed a number of rail cars tumbled over on their sides along the tracks. Several were twisted or partly crumpled in a parking lot near the tracks, with mounds of coal spilled across the lot, piled around and on top of parked cars.

The cause of the wreck has not been determined, police said. The National Transportation Safety Board has taken over the investigation.

The train originated from Grafton, West Virginia, and was bound for Baltimore, the company said. CSX, the second-largest U.S. railroad by both revenue and stock market capitalization, said the accident has not significantly affected rail traffic in the region because of alternative routes in the Baltimore area.

CSX operates about 21,000 miles of rail right of way in 23 eastern states and the Canadian provinces of Ontario and Quebec.