JOHANNESBURG—Attackers entered a South African mosque after midday prayers, stabbed three people and set the place on fire before fleeing, police said Thursday, as people expressed shock at the kind of attack rarely seen in this country. One victim later died, police said.

“The motive of the attack on the three men is unknown at this stage,” Capt. Nqobile Gwala with police in KwaZulu-Natal province told The Associated Press in an email.

The three attackers slit people’s throats, said an emergency responder, Reaction Unit South Africa. Police said they found a knife at the scene. Images from outside the mosque showed bloodied men on the ground receiving medical care.

The other victims were in critical condition after the attack in the eastern town of Verulam, just north of the city of Durban, South Africa’s state broadcaster SABC reported.

The attack came shortly ahead of the Muslim fasting month of Ramadan, which begins around May 16.

“We are not gonna be intimidated by what has happened to us,” a representative of the Imam Hussein mosque, Azad Seedat, told broadcaster eNCA. Friday prayers will go on as usual, he said.

South Africa has not been a target for militant attacks of the kind that occur in some other African countries.

It was too early to comment on the circumstances of the attack, said Nick Piper, a director at Signal Risk, an Africa-focused risk management firm. “Given the low baseline terrorism risk in South Africa, incidents of this nature are, on average and without further evidence, more likely to be linked to personal or communal grievances than acts of terror as we understand them,” he told The Associated Press in an email.