South African police have used stun grenades, rubber bullets and water cannon to try to disperse anti-immigration protesters in the capital, Pretoria, and keep them from foreign nationals who had gathered to express alarm about recent attacks.

A police official said 136 people had been arrested in the past 24 hours.

Resentment against foreign nationals has sometimes turned deadly amid accusations that they take jobs from locals in a country where unemployment is more than 25%. Others are blamed for drug-dealing and other crimes.

In 2015, anti-immigrant riots in and around the city of Durban left at least six people dead. About 60 people were killed in similar violence seven years earlier.

On Friday protesters in Pretoria marched towards the foreign ministry, some carrying sticks or pipes. A petition was handed to the ministry in which they suggested the government teach immigrants to “speak properly”. The petition added: “They are arrogant and they don’t know how to talk to people, especially Nigerians.”