A man stabbed two people to death and wounded two others in an attack Thursday at a mosque in South Africa before being shot dead by police, officers said.
Police have surrounded the building in Malmesbury near Cape Town outside which a body lay under a tree and a penknife had been discarded nearby, said an AFP correspondent at the scene. The attacker's motive remains unclear.
It comes just a month after a deadly stabbing at another South African mosque which police said had "elements of extremism" and left an Islamic leader dead.
Police were alerted by early morning worshippers and arrived at Malmesbury's mosque to find two people had died of stab wounds, Western Cape police spokeswoman Noloyiso Rwexana, told AFP.
"The suspect, believed to be in his thirties and armed with a knife, charged at the police who tried to persuade him to hand himself over," she said.
"He ignored the calls and tried to attack police. He was shot dead."
Rwexana said police are now "combing the scene for clues".
Local media said the suspect was Somali, but police have not confirmed this.
Zainab Bassa, the wife of 72-year-old Ismail Bassa who was killed in the attack, told AFP that her husband of more than 30 years was "slaughtered" as he prayed.
"My husband talked to everybody, he loved kids, it's a great loss for me, as well as for the community, to pass away in a masjid, murdered, slaughtered," said Bassa, 59.
"That was his second house -- you would always find him in the mosque. He left last night and said 'I'm going now, I'll buy you another Eid dress'."
Two other people were wounded and are being treated in hospital.
The Muslim Judicial Council (MJC), which represents the Muslim community in South Africa, said it was "shocked to the core" over the incident, which came at the end of the holy month of Ramadan.
The MJC appealed to the community not to speculate about the attacker's motives and said its top leadership would travel to the area to assist the community.
It comes a month after an attack at a mosque in the town of Verulam, on the outskirts of the eastern port city of Durban.
Three unidentified assailants killed a mosque leader on May 10 by slitting his throat and injured two others after midday prayers.
The assailants in that attack, who also set off a petrol bomb inside the mosque, escaped in a car and remain at large.
Their motive remains unclear, but a police spokesman said at the time that the attack had "elements of extremism. It shows hatred towards the worshippers".
The Verulam attack was a watershed moment for South Africa, where about 1.5 percent of the country's 55 million people are Muslim.
Asked if Thursday's attack was the first of its kind in the region, police spokesman lieutenant colonel Andre Traut said: "I can't recall of another incident, but all possibilities are being investigated".
"It's way too soon to speculate as to a possible motive -- or link with any other incident in the country," he told the eNCA broadcaster.
Nick Piper, a director at the Signal Risk security consultancy, described both attacks as "very rudimentary".
"Typically, if a transnational group was to conduct a coordinated, planned attack, it would be more sophisticated," he said.
South Africa prides itself on religious tolerance and has been spared the extremist attacks that have dogged other countries on the African continent.
Ebrahim Rasool, a senior official of the ruling African National Congress party, said that President Cyril Ramaphosa "expresses condolences to the families and the community".
"(He) expresses his concern about this plague that is infiltrating the Muslim community of intolerance, killing and real conflict," said Rasool.