Several patients and workers were trapped after a roof collapsed at Johannesburg's Charlotte Maxeke state hospital on Thursday near the central business district, emergency services said.

The roof caved in as construction workers were trying to seal a leak. Five people were injured and it was not clear how many people were still trapped under the rubble.

Two of the injured were patients, two were construction workers while one person was a hospital staff member.

The hospital, one of South Africa's biggest, is nicknamed Joburg Gen and is used for academic purposes due to its proximity to the University of the Witwatersand.

"There are several patients trapped. Rescue workers are busy on the scene at the moment trying to ascertain the safety," ER24 spokesman Russel Meiring said.

Television footage showed rescue workers trying to remove rubble and steel pipes to try and reach those trapped by the debris as heavy rain pounded the South African commercial capital.

Eye Witness News quoted sources at the scene saying two people were trapped in the rubble and that one person had been removed. The eNCA television channel said four people had been injured.

State hospitals in South Africa have been struggling with persistent underfunding for staff, equipment and facilities.