The low-rise building had been used as a dealership for Mercedes-Benz cars.

Rescue teams pulled 19 survivors from the rubble of a commercial building that collapsed in Shanghai on Thursday as it was undergoing redevelopment, authorities said, leaving one person unaccounted for.

The accident occurred at around 11:30 am (0330 GMT) in a central Shanghai neighbourhood when the roof of the two-storey building caved in on construction workers, trapping 20 people, fire rescue officials said on social media.

A verified account run by China's emergency ministry showed pictures of rescue personnel pulling bloodied and dust-coated workers out from amid piles of rubble, toppled concrete pillars and shattered wooden beams.

The low-rise building had previously been used as a dealership for Mercedes-Benz cars, the fire rescue bureau said.

Chinese media reports said it was being redeveloped as a mixed-use arts and innovation site.

A local resident told AFP she was taking a nap when her bed suddenly began shaking, as if in an earthquake. She then heard a loud bang.

"I thought it was an explosion at first," said the woman, who declined to give her name or to comment further.

The bureau did not announce any deaths nor provide details on injuries. Authorities quickly sealed off the area with a huge security presence, preventing journalists from getting close.

Chinese media reports said the structure was around 3,000 square metres (32,000 square feet) in area. Aerial pictures on social media indicated that the roof of about half of the building collapsed.

China has seen numerous building collapses in recent years, typically blamed on low-quality construction and the flouting of safety rules.

At least 20 people were killed in 2016 when a series of crudely-constructed multi-storey buildings that were packed with migrant workers collapsed in the eastern city of Wenzhou.