The Ottomans remained for the next 400 years, except for a brief occupation by Ibrahim Pasha of Egypt from 1832 to 1840. Because of its importance as the point of departure for one of the two great Hajj caravans to Mecca, Damascus was treated with more attention by the Porte than its size might have warranted—for most of this period, Aleppo was more populous and commercially more important. In 1560 the Tekkiye al-Sulaimaniyah, a mosque and khan for pilgrims on the road to Mecca, was completed to a design by the famous Ottoman architect Mimar Sinan, and soon afterwards a madrasa was built adjoining it.