BEIJING (AP) — Two carriages of a passenger train fell into a river Thursday after floods knocked out a bridge in southwestern China, but all passengers were able to escape safely, state media reported.

The accident happened at 3 p.m. in Guanghan, a city about 50 kilometers (30 miles) north of the Sichuan provincial capital of Chengdu, when floods loosened piers on the Shitingjiang bridge, the official Xinhua News Agency said.

The train was traveling along when it began shaking and then stopped moving, dining car supervisor Wang Baoning told China Central Television. Two carriages of the train were dangling over the muddy, rushing waters of the river in a "V'' shape, he said.

It took more than 10 minutes to evacuate passengers from the cars, which were still connected to adjacent carriages, Wang said.

"Less than two minutes later, one carriage fell into the river. About 10 minutes after that, the other one fell in too," he said. There were no fatalities.

The train cars had washed a short distance downstream and were almost completely submerged, trapped against the base of another bridge, CCTV footage showed.

The train was traveling from Xi'an in northwestern Shaanxi province to Kunming in southwestern Yunnan province.

China has been hit hard by floods and landslides in recent months that have left hundreds dead and washed away settlements in some parts of the country. The storms have caused tens of billions of dollars in damage.