In Chefchaouen, Morocco, legend maintains that under the cover of darkness, local women team up in pairs to paint the streets and houses blue—upholding a roughly 500-year-long tradition that has brought fame, and an influx of tourism, to the city.

Up until the mid-20th century, Chefchaouen (or “Chaouen,” for short) was an unassuming stop along the trading route between Fez and Tangier. Now, despite its relatively off-the-beaten-path location on the northern tip of Morocco, tourists flock to the city year-round to witness its magical powder-blue streets, for which it’s earned the nickname “the Blue Pearl.”

Photo by Franx, via Flickr.

Though Chefchaouen’s beauty first attracted Western backpackers in the 1960s, its popularity has accelerated in the age of Instagram, when wanderlust is fueled by Instagram feeds and filters. Enthusiasm for the city is not unlike that of Australia’s millennial-pink Lake Hillier, Peru’s so-called “Rainbow Mountain,” and other strikingly colorful sites around the world. But Chefchaouen still remains less congested than other cities in Morocco, and offers a relaxing lull between the more frenetic streets of Fez and Marrakech.

’s vibrant Moroccan landscapes. Inside the medina, or old quarter, alleyways are swathed in blue and dotted with elegant carved doors and colorful flower pots. A visitor’s typical afternoon in Chefchaouen might include exploring the main square, Place Outa el Hammam, where shops brim with hand-woven rugs and brass teapots; admiring weavers, leather artisans, and woodworkers at their craft; and dining on lamb tagine or sipping mint tea on café terraces. And just outside of the city, Talassemtane National Park offers scenic day hikes through the Rif mountains.

Photo via Wikimedia Commons.

Photo by Stephanie Wang.

Chefchaouen translates to “watch the horns” in Berber, in reference to the two Rif mountain peaks that surround the town. The city was founded in 1471 in a deliberately inaccessible location on a remote slope, to halt the advance of the Portuguese army. Shortly after its founding, it grew from a single walled fortress, or kasbah (which still stands at its center), to a bustling metropolis with the arrival of local tribes, in addition to Spanish Moors and Jewish exiles from Europe during the Middle Ages. Andalusian influences are still visible throughout the old quarter in the ornate archways and red-tiled rooftops.

It’s in this area of the city that the tradition of blue-washing originates. The prevailing story is that Jews who settled in the city after their expulsion from Spain in the 15th century began to paint their homes blue as an expression of their cultural and religious beliefs. In Judaism, blue, as the color of the sea and sky, represents divinity. Jews historically painted household objects and dyed prayer mats blue to be reminded of God’s glory in their daily lives.

Photo by jbdodane, via Flickr.

But the origins of the practice remain uncertain, and information varies across sources—perhaps due to the fact that the city’s history has largely preserved through oral storytelling. Many locals attest that the blue walls were, until recently, found only in the mellah, the medina’s Jewish quarter, where Jewish families were ordered to relocate by the local sultan in the late 18th century.

Chefchaouen’s Jewish population has long since dispersed, but residents continue to paint their houses shades of sky blue up to three times per year. Though some say this is supposedly to keep houses cool or to fend off mosquitoes, it’s likely that the practice is a gesture of civic unity or pride in their hometown—especially since the colorful walls have put the previously overlooked city on the tourist map.

It’s no wonder that the practice continues. Whatever the exact reason, the beauty of the city is undeniable.