At least 27 people have been killed and 26 others injured in two separate mass shootings in Johannesburg and Cape Town, South African police have said.

The first attack occurred at about 7:30pm GMT on Saturday when eight armed men reportedly stormed a tavern in Wedela, southwest of Johannesburg.

Police said the gunmen, armed with assault rifles and pistols, initially opened fire on customers gathered outside the bar before entering the premises and continuing the attack.

Seventeen people, including 13 men and four women, were killed, while 15 others sustained injuries.

The attackers reportedly set two vehicles on fire before escaping from the scene.

Police said the motive remains unclear, although investigators believe the shooting may have been linked to an earlier incident at the same tavern.

Deputy provincial police commissioner Major General Fred Kekana said one of the victims was wanted by police over a shooting at the tavern last month, in which one person was killed and another injured.

Hours later, another deadly shooting was reported at a barbecue venue in a township outside Cape Town.

Gunmen opened fire on people attending the gathering, killing 10 and injuring 11 others. Police said two of those killed were women.

Five victims were pronounced dead at the scene, while the others died while being taken to hospital.

Videos circulating on social media showed people drinking and dancing shortly before gunshots were heard, prompting revellers to flee for safety.

Police said no arrests had been made in connection with either attack.

The latest incidents have renewed concerns over South Africa’s persistent gun violence, which authorities say is frequently associated with gangs, organised crime and disputes involving local businesses.

President Cyril Ramaphosa said security agencies would intensify efforts to tackle violent crime, stressing that people should not be able to use firearms to attack others at random.

The shootings came barely a week after 11 people, including a pregnant woman, were killed when gunmen attacked a house party in Durban.

South Africa has repeatedly deployed soldiers to support police operations in areas affected by violent crime.

Meanwhile, police in Johannesburg are investigating a separate series of killings involving 11 women in one municipality over a two-month period. Authorities have offered a 400,000-rand reward for information that could lead to the arrest of those responsible.