The caravanserai, known regionally as a khan, funduq or wikala, was the fortified roadside inn that lodged merchants, travellers and their pack animals along the trade routes of the Islamic world. Built as a square or rectangular walled enclosure with a single guarded gate, an open courtyard and surrounding stalls, stores and sleeping cells, examples were spaced roughly a day's journey apart across the caravan network. Construction intensified from the tenth century during periods of stability, and urban versions doubled as warehouses, customs houses and wholesale exchanges within the bazaar. Many were endowed as waqf, their rents funding mosques and other charitable institutions.
The caravanserai was the node that made long-distance overland trade viable, securing goods and travellers and seeding markets, lodging and exchange where routes met. Its urban form, the commercial khan, became a core building block of the bazaar and a generator of city growth along trade corridors.