What a World

08.28.14 9:45 AM ET

Morocco's Secret All-Blue City

A city high in the mountains of Morocco remained shut off from the world for almost 500 years. Now its labyrinthine streets decked in shades of blue are open to visitors.

Holland’s multi-colored hamlets are nice, there’s no place quainter than England’s yellow-brick Cotswolds, and Greece has beautiful whitewashed islands. But few cities can compete with the magical charm of a hilly northern Moroccan outpost that was kept locked away from the rest of the world for centuries and is painted entirely in shades of blue.

Tucked into the Rif Mountains, the bright blue city of Chefchaouen seems like a mirage, situated as it is in the middle of an all green-and-tan landscape. The city was founded in 1471 as a base for Moroccans to fight off the invading Portuguese, who occupied the coastal areas. Its remote and mountainous location, four hours from the sprawling metropolis of Fez, kept the city insulated and enabled its inhabitants to successfully fend off foreign influence, unlike its bigger neighbor.

View of Chefchaouen (Chaouen) blue town in Morocco

Dave Stamboulis/Getty

In the following centuries, Chefchaouen became known as a refuge for Jewish and Muslim minorities leaving Europe, and, for half a millennium, it managed to stay relatively isolated from the ever-changing rulers of Morocco. It wasn’t until the early 20th century that the walled city was finally captured by Spain and its gates opened to the outside world.

During the Spanish Inquisition in the late 15th century, many Jews and Muslims chose to flee across the thin Strait of Gibraltar separating Africa from Europe instead of stay and be forced to convert to Christianity. A good portion of these refugees made their way to Chefchaouen. Once there, the Sephardi Jews painted every building and home in the old city cool shades of blue, most likely because it’s the color of divinity in Judaism (although another theory claims it repels flies).

But the city had limits to its acceptance—early on, all foreigners, especially Christians, were barred from entering the walled city under the threat of death. It’s thought that only three outsiders—a French and an American missionary and a British journalist—made it in (and one was reportedly killed) in the late 1800s. The town had remained so closed off from the rest of the world that the visitors reportedly found its Jewish inhabitants were still speaking a 15th-century version of Spanish.

Locals spent centuries fighting off invading forces, from the Berbers to the Portuguese, but Chefchaouen finally succumbed after a successful Spanish occupation in 1920. Residents fought back and gained their freedom for two years, but were occupied again in 1926, and remained under Spanish control until Morocco gained independence 30 years later.

Today, the city is a dream for wanderers and adventurers. Chefchaouen’s steep, winding alleyways baffle even the most directionally astute visitors in the car-free old town. Vendors peddle a colorful array of goods: the country’s famed leather products, omnipresent carpets, and traditional woven blankets. Tucked away antique shops are piled floor-to-ceiling with dusty relics. Luckily, the cool mountain air dilutes Morocco’s normally stifling summers, since most browsing sessions include a curved glass of sweet mint-stuffed tea.

Chefchaouen, shut off from the world for centuries, is almost absurdly picturesque. Stairways painted blue connect covered walkways stuffed with small stores selling jewelry, scarves, and ornate pottery. When the shops close for the night, their blue doors add another layer of color and texture to the structures, which are constantly being repainted. Building walls are strung with potted plants, lined with sacks of fluorescent spices, and studded with ornately peaked archways and windows.

The central old medina, a calm place compared to the shrill sights and sounds of Morocco’s major cities, is lined with olive trees and restaurants offering tagines, peaked dishes of roasted vegetables, and meat served with couscous. The ancient Grande Mosque and Kasbah fortress line the main plaza square. Hotels arrange accommodations around a shared courtyard, as the traditional Moroccan architecture of the riad mandates. Down the hillside, a steep collection of streets turns into a bazaar twice a week, where anything from bike wheels to fabrics can be purchased.

In this northern tip of Morocco, surrounded by vast marijuana plantations that supply kif to the area, the vibrant city sits between two looming mountains, more open than it once was, but still an isolated escape from the country around it. In homage to this landscape, the town was given its name, “Chefchaouen,” which translates to “watch the horns” in the Berber language, a reference to the two goat horn-shaped peaks behind it that paint a dramatic backdrop for a little blue town of unparalleled beauty.