Fes is the spiritual heart of Morocco and is the most ancient, and indeed the greatest, of the country's imperial cities. It's one of the undisputed highlights of any visit to Morocco. Within the walls of its medina, Fes el Bali (Old Fes), lies the world's largest intact medieval city. More than 9,500 narrow streets and dim alleyways wind endlessly up and down, around and around, crammed with people, music, noise, and smells. Whether arriving from within Morocco or elsewhere, nothing can prepare you for this assault on the senses.

Fes means different things to different people. To some, it is a center of the decorative arts, world famous for its leather and metalwork and the skill of its master craftsmen, or maâlem. Others may see it as the home of the Kairouine Mosque, the second largest in North Africa and neighbor of the oldest university in the world. For others still, Fes conjures an image of the quintessential fabled Arab city from a time when traveling merchants from the Middle East traded with nomads from the Sahara and Berbers from the mountains.

It was in the year 786, 150 years after the death of the Prophet Mohammed, that one of his descendants set foot in Morocco. Idriss Ben Abdallah Ben Hassan Ben Ali was destined to become Moulay Idriss, patron saint of Morocco and founder of Fes. Blamed for a failed rebellion against the Arabian Abbaysids, he had fled Baghdad and come to el-Maghreb el-Aksa of the Muslim world.

Idriss settled in the Roman city of Volubilis and was quickly accepted among the local Berbers as their spiritual leader, or imam. Before long, he established Morocco's first independent Islamic kingdom, the Idrissid dynasty. He began his empire (which was later named in his honor) near Volubilis, but during his short reign (he was poisoned in 791 by an Abbaysid assassin) he also laid the foundation for a new capital in a shallow basin of the Wadi Fes, strategically situated at the junction of Morocco's major trading routes. Idriss fathered a son, Idriss II, with a Berber woman, and by 809 the young Idriss set about continuing his father's work and began expanding the town of Fes in earnest.

The town's growth was rapid, boosted early in the 9th century by two waves of migrations that formed the religious and artistic base from which the city still emanates today. The first were Muslim refugees fleeing civil war in Cordoba, who settled on the east bank of the river in an area that became known as Adwat al Andalus, "the Andalusian Quarter." These Andalusians included craftsmen, merchants, and learned citizens who brought along their experience of urban life and their ancestral techniques in masonry and the craft industry. The second influx came from Jewish and Muslim immigrants from the holy Tunisian city of Kairouan, who brought with them their business acumen and spiritual knowledge. It was the Kairouanese who founded Fes's famed Kairouine Mosque and theological college. Together, these two migrations ensured that for centuries to come, Fes was to be a center of intellect and creativity.

The city continued to grow in the 11th century, with the coming of the Berber Almoravids who constructed Fes's ancient water and sewage system, an incredible feat of hydro-engineering that to this day is in full working order. The city's golden age, literally, came with the rise to power of the Merenids and their predecessors, the Wattasids. For 300 years, these dynasties ruled from Fes, which greatly benefited from the pious nature of their sultans (a building spree of mosques and medersas included the Bouinania on Tala'a Kebira) as well as the expansion of the West African caravan routes and the gold, ivory, and slaves that came with them. They also constructed an entirely new city -- Fes Jdid, or New Fes. In the 16th century, amid the chaos of the fall of Granada, the last Muslim kingdom in Spain, hundreds of thousands of Jewish and Muslim refugees fled to North Africa, many settling in Fes Jdid. From then on, Fes was to figure little in Moroccan history, as political power shifted to Meknes and Marrakech. That is, until 1912, when it became the unwilling stage for the signing of the infamous Treaty of Fes that handed Morocco to France and Spain. Open rebellion broke out just 2 weeks later, and 80 Europeans were lynched. The next day, the French bombarded the city and promptly moved the seat of power to Rabat. Although this may have initially appeared as a humiliating episode for the city, in a sense it actually reasserted its status as the center of national pride.

The city, it must be remembered, is not one but three. Constructed at different times in history and for different reasons, the combination of Fes el Bali, Fes Jdid, and the French-designed ville nouvelle was described to me by a local Fassi as une ville authentique -- a real city. One finds things here that exist nowhere else." This uniqueness led, in 1980, to Fes becoming the first Islamic and Arab city to be designated a World Heritage Site, joining Venice and Havana, among others. At the time, more than 300,000 people lived within the city's ancient walls, which were close to bursting at the seams. UNESCO recognition brought about a plan to rescue the city via the Agence pour la Dédensification et la Réhabilitation de la Médina de Fès, or ADER-FES. Since then, through various inducements, the population of Fes el Bali has been reduced to somewhere near 200,000 while the city's total urban area has grown to at least one million. In a project that could last as long as 20 years, ADER-FES has identified 11 medersas, 320 mosques, 270 foundouks, and more than 200 hammams, houses, or public ovens worthy of preservation. Some structures are famous and have undergone or are undergoing restoration already -- for example, the Kairouine Mosque, the Bouinania Medersa, the Nejjarine Fountain, and the Foundouk Nejjarine. Others are only known to locals, who feel they represent key aspects of the city's cultural heritage.

This resurgence of pride in the architectural beauty of Fes is also being helped along by increased flight arrivals into the city courtesy of the government's 2006 open-skies policy, and the seemingly weekly immigration of Westerners -- including a marked increase of Brits -- restoring and moving into the medina's old dars and riads. Whether this will turn Fes into the "new Marrakech" is a question being asked by some. Certainly, Fes has become one of the world's "in" exotic destinations in recent years, attracting a traveler that historically would have journeyed to places less confronting. The recent introduction into the medina of a Brigade Touristique to curtail the hassle from unregistered guides only adds to the city's marketable stature. For a city that desperately requires employment for its impatient youth, tourism can bring fast and direct economic benefits. But whether this comes at the expense of the very culture and tradition that attracts the traveler in the first place is yet to be seen. For the moment, Fes deserves all the attention it is receiving. To walk within its old walls is to witness a city that is heaving and claustrophobic, fascinating and frustrating, decrepit and majestic, inspirational and wondrous, and waiting to be discovered every day.

Fes or Fez? -- The Western name for the city is drawn from its Arabic name "fas," which itself refers to a pickax of silver and gold presented to Moulay Idriss I to use in tracing the outlines of his new city. There is no one correct way to translate Arabic words into Western characters. The French have always referred to the city as "Fes," while Americans tend to use "Fez." Fassis themselves use Fes, most likely due to the long history of colonial French presence in Morocco.