Provincial spokesperson, Andre Traut, said police rushed to the scene and found two worshippers stabbed to death.
Mr Traut said the attacker was shot dead at the scene by police.
Witnesses described the attacker as a foreigner in his 30s.
This was the second attack on a mosque in the country since May.
On May 10, three knife-wielding attackers stormed a mosque in Verulam, KwaZulu-Natal Province, killing one worshipper and seriously wounding two others.
The suspects, reportedly from Egypt, escaped from the scene before setting the mosque on fire. No arrest has been made so far. The motivation for the killing is still unknown.
Religious organisations said there is no doubt that the knife attacks had been orchestrated by “terrorists.”
But authorities said they need evidence to link the attacks with terrorism.