Morocco's northwest region is home to the city of Meknes. As a military outpost, it was established by the Almoravids in the eleventh century. It served as Morocco's capital throughout the 17th century while the Alaouite dynasty ruled. The Medina, the Royal Palace, and the Bou Inania Madrasa are among the city's well-preserved historical structures. The city also features a number of gates, including the Bab Mansour, which is regarded as one of Morocco's most exquisite gateways. In addition, Meknes has a number of parks and gardens, including the Agdal Gardens and the Heri es-Souani, a 17th-century irrigation system. The Moulay Ismail Mausoleum, the Dar Batha Museum, and the Place El-Hedim, a sizable plaza in the middle of the city with a market and a number of historic structures, are a few of the tourist attractions in Meknes.