More than 50 people have died in South Africa after torrential rain caused flooding and mudslides.

Rescue workers were digging through collapsed homes and other buildings in coastal areas of KwaZulu-Natal province on Wednesday, where the death toll stood at 51, officials said.

The region has been hit by heavy rains for days, but authorities did not anticipate the extent of the downpour late on Monday, according to Lennox Mabaso, a spokesman for the provincial cooperative governance and traditional affairs department.

“As a result there was flooding and some structures were undermined and collapsed on people,” said Mr Mabaso, adding that some people were swept away by the water.

KwaZulu-Natal Emergency Medical Services spokesman Robert McKenzie said multiple dwellings and houses collapsed in the mudslides.

South Africa floods: At least 50 killed in flooding and mudslides Show all 10 1 /10 South Africa floods: At least 50 killed in flooding and mudslides South Africa floods: At least 50 killed in flooding and mudslides Police officers try to rescue people trapped in their homes destroyed in a mudslide following torrential downpours and flash floods in Chatsworth, south of Durban, in the South African region of KwaZulu-Natal. Rajesh Jantilal/AFP/Getty Images South Africa floods: At least 50 killed in flooding and mudslides Floodwaters wash through a property near Durban, South Africa, Tuesday, April 23, 2019. South African media report Tuesday that at least 33 people are dead from flooding and mudslides in the country's eastern KwaZulu-Natal province caused by heavy rains that began on Monday. (AP Photo) AP South Africa floods: At least 50 killed in flooding and mudslides Women begin to re-build their homes after they were destroyed by torrential rains and flash floods destroyed houses at an informal settlement of BottleBrush, south of Durban, on April 23, 2019. - The death toll from floods and mudslides that crushed homes in the South African port of Durban on April 23 has risen to 33, with reports of children missing and scores of people displaced, authorities said. (Photo by RAJESH JANTILAL / AFP)RAJESH JANTILAL/AFP/Getty Images RAJESH JANTILAL Rajesh Jantilal/AFP/Getty Images South Africa floods: At least 50 killed in flooding and mudslides Debris floats in Durban's harbour after a storm, at Wilson's Wharf, in Durban, South Africa April 23, 2019 in this still image obtained from social media. Nathan Balladon via REUTERS ATTENTION EDITORS - THIS IMAGE HAS BEEN SUPPLIED BY A THIRD PARTY. MANDATORY CREDIT. NO RESALES. NO ARCHIVES SOCIAL MEDIA Nathan Balladon South Africa floods: At least 50 killed in flooding and mudslides People begin to clear debris at an informal settlement of BottleBrush, south of Durban, after torrential rains and flash floods caused huge damages to their homes on April 23, 2019. - The death toll from floods and mudslides that crushed homes in the South African port of Durban on April 23 has risen to 33, with reports of children missing and scores of people displaced, authorities said. (Photo by RAJESH JANTILAL / AFP)RAJESH JANTILAL/AFP/Getty Images RAJESH JANTILAL Rajesh Jantilal/AFP/Getty Images South Africa floods: At least 50 killed in flooding and mudslides Vehicles and debris are scattered on side of a cliff in Durban, South Africa April 23, 2019 in this picture obtained from social media on April 24, 2019. Gavin Welsh via REUTERS ATTENTION EDITORS - THIS IMAGE HAS BEEN SUPPLIED BY A THIRD PARTY. MANDATORY CREDIT. NO RESALES. NO ARCHIVES SOCIAL MEDIA Gavin Welsh via Reuters South Africa floods: At least 50 killed in flooding and mudslides TOPSHOT - People begin to remove debris after their homes were destroyed by torrential rains and flash floods at an informal settlement of BottleBrush, south of Durban, on April 23, 2019. - The death toll from floods and mudslides that crushed homes in the South African port of Durban on April 23 has risen to 33, with reports of children missing and scores of people displaced, authorities said. (Photo by RAJESH JANTILAL / AFP)RAJESH JANTILAL/AFP/Getty Images RAJESH JANTILAL Rajesh Jantilal/AFP/Getty Images South Africa floods: At least 50 killed in flooding and mudslides TOPSHOT - This picture taken on April 23, 2019 shows the Umhlatuzana Hindu Temple, south of Durban, damaged after the township was hit by heavy rain and flash floods following torrential downpour on April 23, 2019. - The death toll from floods and mudslides that crushed homes in the South African port of Durban on April 23 has risen to 33, with reports of children missing and scores of people displaced, authorities said. (Photo by RAJESH JANTILAL / AFP)RAJESH JANTILAL/AFP/Getty Images RAJESH JANTILAL Rajesh Jantilal/AFP/Getty Images South Africa floods: At least 50 killed in flooding and mudslides People stand on a damaged road after massive flooding in Amanzimtoti, near Durban, South Africa April 23, 2019 in this picture obtained from social media on April 24, 2019. Gavin Welsh via REUTERS ATTENTION EDITORS - THIS IMAGE HAS BEEN SUPPLIED BY A THIRD PARTY. MANDATORY CREDIT. NO RESALES. NO ARCHIVES SOCIAL MEDIA Gavin Welsh via Reuters South Africa floods: At least 50 killed in flooding and mudslides Vehicles and debris that have been washed away after massive flooding are seen behind a damaged building in Amanzimtoti, near Durban, South Africa April 23, 2019 in this picture obtained from social media on April 24, 2019. Gavin Welsh via REUTERS ATTENTION EDITORS - THIS IMAGE HAS BEEN SUPPLIED BY A THIRD PARTY. MANDATORY CREDIT. NO RESALES. NO ARCHIVES SOCIAL MEDIA Gavin Welsh via Reuters

Some major roads in and around the port city of Durban were reportedly closed on Wednesday.

Flooding also killed at least three people in the Eastern Cape province, according to state broadcaster SABC.

President Cyril Ramaphosa plans to visit communities in both provinces.