No injuries were reported.
At least 32 cars on the CSX freight train derailed about 5 a.m. in Hyndman, about 100 miles (161 kilometers) southeast of Pittsburgh, said CSX spokesman Rob Doolittle. The train was traveling from Chicago to Selkirk, New York.
At least one car containing liquid petroleum gas, and one containing molten sulfur leaked and caught fire, Doolittle said. A residential garage struck during the derailment also caught fire, officials said.
It was not immediately known what caused the train to run off the rails, and the fire continued to burn hours after the derailment.
The only confirmed structure fire was at the garage, but video from the scene seems to show more extensive damage.
Aerial footage of the derailment shows a number of cars stacked nearly perpendicular to the tracks while others landed in a burning, zig-zag pattern in a residential area where some structures seemed crushed and other ablaze.
Hyndman resident Jim Shaffer told the (Cumberland) Times-News he was awakened by the sound of crashing rail cars.
"It woke me up. It was louder than a thunderstorm," he said. "I heard the cars banging into each other. Then I heard the fire whistle."
Bedford County 911 coordinator Harry Corley said officials ordered everyone within a 1-mile radius of the derailment to leave hours after the derailment. The order encompasses the entire town of Hyndman, and residents have been directed to a local church for help with lodging and food.
Democratic Gov. Tom Wolf, in a phone interview from the evacuation center several miles away from the train, said some neighbors have refused to leave their homes.
"But everyone knows where they are and they're safe at this point," Wolf said Wednesday afternoon.
Only a few people were in the church, as most evacuees chose to go to hotels or the homes of friends or relatives, he said.
Wolf said officials were conducting air and ground studies to determine possible health effects.
He said area residents have "a lot of uncertainty and everyone's hoping for the best, praying for the best."
Asked about the risk of a propane explosion, Wolf said, "There's always that possibility. I think, from what I hear, the potential of that happening has diminished somewhat."
A number of roads are closed, and some flight restrictions are in place.
Amtrak suspended train service between Pittsburgh and Washington, D.C., providing buses to take passengers between the two stations.
"CSX apologizes for the impact that this incident is having on the residents of Hyndman," Doolittle said.
Hyndman is a town of just over 800 residents near the Maryland border.
"CSX's top priority is to work cooperatively with first responders and other officials to protect the public's safety, and CSX personnel are on the scene assisting first responders, providing information about the contents of the train and expertise on responding to railroad incidents," Doolittle said.
Send a breaking news alert
Report a correction or typo
Learn more about the 6abc apps