Asilah is a fortified town on the northwest tip of the Atlantic coast of Morocco, about 31 km (19 miles) south of Tangier. Its ramparts and gateworks remain fully intact.

The town's history dates back to 1500 B.C., when the Phoenicians used it as a base for trade. The Portuguese conquered the city in 1471, but later it was decided to abandon it because of an economic debt crisis in 1549. Later in 1578, Sebastian of Portugal used Asilah as a base town for his troops during a planned crusade that resulted in Sebastian's death, which in turn caused the Portuguese succession crisis of 1580. The Moroccans in 1589 regained control of Asilah briefly, but then lost control of it to the Spanish.

In 1692, the town was again taken by the Moroccans under the leadership of Moulay Ismail. Asilah served then as a base for pirates in the 19th and 20th centuries, and in 1829, the Austrians punitively bombarded the city due to Moroccan piracy.

From 1912 to 1956, it was part of Spanish Morocco. A major plan to restore the town was undertaken in 1978 by its mayor, Mohamed Benaissa. The first edition of an art festival known as the International Cultural Moussem of Asilah was launched that year to help generate tourism. It was successful in generating revenue for the city and played a role in raising the average monthly income from $50 in 1978 to $140 in 2014. The festival features local artwork and music and continues to attract large amounts of tourists.

Asilah is now a popular seaside resort, with modern holiday apartment complexes on the coast road leading to the town from Tangier.