Several patients are trapped after a section of roof at the entrance of a large hospital in South Africa collapsed, emergency service officials have said.

Rescue workers were seen frantically digging for survivors with their bare hands at Charlotte Maxeke Hospital in Johannesburg (formerly known as Johannesburg General).

The local department of health said at least five people had been injured in the collapse, which happened on Thursday afternoon (2 March).

"There are several patients trapped. Rescue workers are busy on the scene at the moment trying to ascertain the safety," a spokesman for ER24 rescue service also told Reuters.

About a dozen builders had been working on the roof at the time of the collapse, South Africa's Mail and Guardian reported.

Videos posted on social media show chaotic scenes inside the hospital ward.

A 15-year-old girl, who didn't want her name used, told Times Live she was "lost for words" as the roof collapsed just as she was about to enter the hospital.

"I was late for my appointment at the dentist. I was about to go in when it happened. In my mind, I didn't think the roof would fall. I'm lost for words," she said.

"All I saw was the roof collapse, and then there was a lot of dust. I could just hear people scream and then we came outside.

"I'm glad I wasn't trapped inside, but I still feel really bad for the people trapped inside."

It was not immediately clear what caused the roof to collapse, but employees speaking to local media claimed it had long suffered from leaks.

hospital collapse
Rescuers at Charlotte Maxeke Hospital dig for survivors Twitter/ER24 EMS

Jack Bloom, health spokesperson for the Democratic Alliance in the local Gauteng province, said he had warned the hospital was "structurally unsound".

Sharing a picture of the roof collapse on Twitter, he wrote: "The devastation at Charlotte Maxeke Hospital - I warned years ago that the hospital was structurally unsound."

A spokesman from the Gauteng province Department of Health said: "[We] can confirm that there has been a structural collapse at Charlotte Maxeke Hospital today (2 March, 2017). The collapse took place in the passage near the maternity department on hospital street."

The hospital, in Johannesburg's Parktown suburb, has a capacity of over 1,000 beds and is one of the city's major hospitals.