Mombasa travels to the Swahili Coast and made some mention of the city, although he only stayed one night. He noted that the people of Mombasa were Shãfi'i Muslims, religious people, trustworthy and righteous. Their mosques are made of wood, expertly built. The exact founding date of the city is unknown, but it has a long history. Kenyan school history books place the founding of Mombasa as 900 A.D. It must have been already a prosperous trading town in the 12th century, as the Arab geographer Al Idrisi mentions it in 1151. The oldest stone mosque in Mombasa, Mnara, was built
Mombasa and defeated the relief force sent by the Portuguese. In 1632 Dom Jeronimo left Mombasa and became a pirate. That year the Portuguese returned and established direct rule over Mombasa. With the capture of Fort Jesus in 1698, the town came under the influence of the Imamate of Oman, subordinate to the Omani rulers on the island of Unguja, prompting regular local rebellions. Oman appointed three consecutive Governors (Wali in Arabic, Liwali in Swahili): Mombasa briefly returned to Portuguese rule by captain-major Álvaro Caetano de Melo Castro (12 March 1728 – 21 September 1729), then four new Omani Liwali until