People have been evacuated from Cape Town neighbourhoods as a huge wildfire sweeping across the slopes of the city’s famed Table Mountain was fanned by high winds and threatened homes.

City authorities said the fire, which started early on Sunday, was still not under control and residents of suburbs on the mountain slopes were now being evacuated as a “precautionary” measure.

The blaze had already damaged the library and other buildings on the campus of the University of Cape Town and other historic buildings on Sunday, and was spreading through the wild bush on the mountain slopes towards the city’s centre and the surrounding residential areas.

Devil’s Peak, one of the most famous points of the mountain which overlooks central Cape Town, was lit up by flames as the fire raged through the night.

A fire rages out of control on the slopes of Table Mountain in Cape Town, South Africa
A fire rages out of control on the slopes of Table Mountain in Cape Town (AP)

Firefighting helicopters with water containers suspended on ropes had been scooping up water from swimming pools and the nearby ocean and dumping it on the fire.

But they were grounded on Monday because of the strong winds.

Four firefighters have been injured battling the blaze on the slopes, said officials.

The South African army had offered to help with some of its aircraft.

“It’s a massive wind that’s blowing, and that is actually fuelling the fire to spread in each and every direction,” Cape Town mayor Dan Plato said.

Firefighters douse the Jagger Library at the University of Cape Town, South Africa
Firefighters douse the Jagger Library at the University of Cape Town (Nardus Engelbrecht/AP)

A man in his 30s has been arrested on suspicion of arson for setting additional fires, another city official said, but it is not clear if he was responsible for starting the blaze.

The man was arrested on Sunday night after witnesses reported seeing three people moving through flames setting more fires, Cape Town safety and security official JP Smith told the Associated Press.

Smith said the city had commissioned a forensic fire investigator to look into the cause.

Wildfires on the mountains surrounding Cape Town are fairly common during the hot, dry summer months and are sometimes whipped up into huge, uncontrollable blazes by strong coastal winds.

Residents leave their homes due to a fire on the slopes of Table Mountain in Cape Town South Africa
Residents leave their homes due to the fire on the slopes of Table Mountain (Nardus Engelbrecht/AP)

The temperature in Cape Town peaked at 35C (95F) on Sunday and the winds hit the city overnight and on Monday.

About 250 city and volunteer firefighters have been deployed to battle the fire that damaged parts of the University of Cape Town (UCT), including its library, a historic windmill, and a restaurant near a memorial for Cecil Rhodes on Sunday.

The Jagger library’s main reading room was completely gutted, the university said, and some important archives and book collections had been lost.

Mr Plato said some valuable works were saved by roller doors that were activated to seal off parts of the library.

“It is tragic that literary treasures have been lost at the UCT library but I have been informed that some of the most valuable works were saved,” he said.

Students make their way after being evacuated from their residence at the University of Cape Town, South Africa
Students make their way after being evacuated from their residences at the University of Cape Town (Nardus Engelbrecht/AP)

Four university buildings were severely damaged and the university has been completely evacuated and shut down.

Meals were being provided for around 4,000 students who had to quickly leave the university campus and their residences, according to Gift of the Givers, a disaster response organisation.

Many of those students were taken to local hotels, the group said.

Activities at the university were suspended until at least Wednesday.

The group said it is also supplying food and water to the firefighters who have been working for more than 24 hours to try to control the fire.

Heavy smoke hung over parts of Cape Town and people were advised to cover their mouths and noses with wet towels or rags while being evacuated.

A fire rages on the slopes of Table Mountain in Cape Town, South Africa
A firefighter tackles the blaze (AP)

Dramatic videos and photos were posted on social media by people who came dangerously close to the blaze on the slopes of Table Mountain, which is popular among runners and mountain bikers on the weekend.

Lisette Lombard posted a video of herself trying to escape the fire on the mountain after going on a trail run on Sunday.

She was seen running, breathless, as plumes of smoke rise close behind her.

Ms Lombard said her car and others left in a car park were completely burnt out and destroyed and she eventually found help from a group of firefighters coming up the slopes.

“When they told me that it (the fire) is out of control, that is when the penny dropped on how dangerous the situation was and how lucky I had got,” she told South African news website iol.co.za.