Tuan Guru was a prince from Tidore in the Trinate Islands and a descendant of the Sultan of Morocco. He was banished by the Dutch invaders to the Cape in 1780 because of a conspiracy against them. He was incarcerated on Robben Island for 12 years until 1792.

After his release he married Khadija van de Kaap and they had two sons; Abdul Rakiep and Abdul Rauf. While on Robben Island, he wrote several copies of the Holy Qur’aan from memory, possibly the first Qur’aans in SA. Two are preserved up to today; one at Dorp Street Musjid, Bo-Kaap and the other with one of his descendants. He also wrote an influential book on Islamic law which became an important source of Islam for Cape Muslims in the 19th century.

When he was released, Tuan Guru stayed in Dorp Street, Cape Town and started the first Madresa in SA; the Dorp Street Madresa in the home of Trijn van der Kaap, where he taught free Blacks and slaves Arabic. Tuan Guru means respected teacher. Based on this model, by 1832 twelve Madresas had been established in the Cape.

Tuan Guru organized the first Juma in SA in the open in a disused quarry in Chiappini Street. In 1795 he established the first Musjid in SA at the Dorp Street Madresa premises. He did all this while the practice of Islam in the Cape was a criminal offense until 1804.

Tuan Guru is buried in Tana Baru graveyard in Longmarket Street, Bo-Kaap.