A man suspected of starting a fire in South Africa's Alexandra township has been killed by a mob.

He died of his injuries after being taken to hospital following the blaze that broke out on Thursday afternoon.

The fire destroyed more than 500 shacks, leaving hundreds homeless. Police are yet to determine the cause.

The BBC's Pumza Fihlani says vigilante killings are common in poor areas where crime is often high and communities feel frustrated with the police.

The densely populated township of Alexandra is north of the city of Johannesburg

Although it right by the affluent Sandton neighbourhood, which is known as Africa's richest square mile, poverty and unemployment are high there, our reporter says.

One eyewitness, who posted a video of the inferno on social media, shared a theory that the fire had broken out because of a fight.

Many people were at work when the blaze started out on Thursday. No other deaths or injuries have been reported.

Fire fighters attended the scene but struggled to contain the blaze. Johannesburg Emergency Medical Services spokesperson Nana Radebe told eNCA TV channel, "We don't have hydrants in this area."

Water in fire engines only lasts four minutes, so access to water hydrants was essential, she said, adding that residents had built over those installed for factories that were once in the area.

The water pressure in one available hydrant was so low it could not be used and a water tanker had to be brought in, Ms Radebe said.

An aid worker told South Africa's TimesLIVE that 690 shacks had been destroyed, affecting 2,000 people, including a woman who had given birth on Thursday.

"We found her sitting on the side of the road. She lost everything," Emily Thomas of Gift for Givers was quoted as saying.

Many people slept outside on Thursday night. As the clean-up operation continues, police are investigating the cause of the fire.

Alexandra has bricks and mortar houses, but many people live in shacks made of corrugated iron and wood. They are often insulated with cardboard and plastic bags, making them highly combustible.