Chinese state media say two subway trains have crashed in Shanghai, injuring dozens of passengers.

The official Xinhua news agency said one train slammed into the back of another as a result of an equipment failure shortly before 3 p.m.

The subway operator, the Shanghai Shentang Metro Group, said more than 40 people were injured but there were no immediate reports of severe injuries. Local television stations put the number of injured at more than 100.

Xinhua published photos of injured passengers being removed from a subway train on stretchers. Photos of bleeding and apparently unconscious passengers were posted on Internet microblogging sites.

The accident had similarities to a train wreck in July that killed 40 people and shattered public confidence in the nation's high-speed rail system.

That accident, in the city of Wenzhou near Shanghai, also involved a rear-end crash and was blamed on equipment failures.

China has poured billions of dollars into its scandal-plagued bullet train network, prompting critics to complain that Beijing has sacrificed safety in its quest for rapid economic growth.

The July crash prompted an unusual outpouring of public anger on social media and even in the normally supportive state-controlled press.