It's early evening and I'm sitting in a garden overlooking the Bay of Tunis.
Bees are murmuring in the honeysuckle and butterflies flit through a tangle of trumpet vine. Behind me is an enormous palm tree, its trunk as chunky and squat as a pineapple. Ahead, the wide blue sea is flecked with white arrow-heads – the sails of small craft returning to the marina below.
The bay is a huge, flat disc of aquamarine, disturbed only by the mauve shadows cast by the twin peaks of Mount Bou Kornine in the distance. According to legend, the peaks are the petrified heads of two pilgrims returning from Mecca. They turned to stone as they stopped to marvel at the very cliff-top site where I am now – the beautiful medieval village of Sidi Bou Said.
It's impossible not to fall in love with the place. Originally a place of pilgrimage for visitors to the tomb of the 13th-century Sufi holy man from whom it takes its name, Tunisia's celebrated blue-and-white village is so enchantingly pretty that it can sometimes seem more painted than real. Seen from a distance, it shimmers under the fierce Mediterranean sun like a giant mosaic. Seen from within, it's a labyrinth of winding streets and secret places, where crooked flights of steps lead to hidden gardens and wooden gates opening onto flower-filled courtyards.
Everywhere you look in the village, you'll see its signature colours – dazzling white walls and staircases, with everything else a uniform shade of vivid blue. Doors, window frames, shutters, decorative iron grilles and elaborate latticework window screens (known as moucharabiehs) are all painted the imperial blue of a peacock's tail. Only the larger doors show some variation, with splashes of chrome yellow, white or red.
Doors are a special feature of the village; ancient, huge and heavy, they're studded with traditional motifs of crescents, minarets and stars. Some lead into simple shops or mini-garages, others open out into more elaborate complexes, such as the Café Sidi Chabaane, which cascades over the cliff-side in tiered terraces like a waterfall. Others mark the entrance to grand mansions with cool, mosaic-tiled courtyards, fountains and orange trees – rather like Moroccan riads.
A number of doors lead into forges, workshops or artists' studios. The Italian artist Soro Lo Turco has a studio and gallery here, for instance. It's a topsy-turvy building up an alleyway, filled with his characteristic smoky ink and pastel paintings. Unsurprisingly, Sidi Bou Said has always been attractive to painters. It became a hideaway for writers and artists visiting from Europe in the late 19th and early 20th centuries. Colette, Simone de Beauvoir and André Gide were among the writers who fell under its spell. Gide described staying there as "bathing in a fluid, mother-of-pearl sedative".
Visiting artists included Henri Matisse, Michael Foucault and Paul Klee. Klee arrived in 1914, with fellow-artists Gustave-Henri Jossot and August Macke. That year, Macke painted a watercolour of the Café des Nattes, which has become one of the most enduring images of Sidi Bou Said. For Klee, who until then had normally worked within the confines of black and brown graphics, his time in the village marked a decisive turning point in his use of light and colour. "Colour has taken possession of me," he wrote. "No longer do I have to chase after it, I know that it has hold of me forever."
By the end of the 19th century, cosmopolitan Tunis had become something of a surrogate Paris for vacationing Europeans. Smaller, prettier, more subtle, and situated 18km from the capital, Sidi Bou Said became Tunis's equivalent of Montmartre – the "alternative" place to stay, or even to settle, for the more Bohemian cognoscenti.
Nowadays, like Montmartre itself, the village is no longer any sort of a secret. Its population has been swelled by an influx of wealthy Tunisians. A number of politicians and media personalities make daily trips between their luxury homes and the capital in what can look like a cavalcade of chauffeur-driven cars with tinted windows. Likewise, the village has been discovered by mass tourism. As an increasingly popular excursion destination in recent years, its cobbled main street has long been worn to a sheen by the daily tidal waves of visitors.
And yet Sidi Bou Said remains enchanting. The secret is to stay for a few days, rather than going on a day trip. As night falls, and the village is returned to its residents, the feet-polished street glistens even more brightly in the moonlight – leaking like a milky river into the shadows of the stairwells and alleyways that cluster below the mosque. Grey cats haunt the roadsides. The birds in the orange trees go silent. And the evening air floods the still-bustling bars and cafés with the familiar drowsy fumes of jasmine, the village's sacred flower. At such moments, the village seems lost in time.
Coach tours apart, most visitors to Sidi Bou Said arrive on the local TGM Métro from Tunis, known locally as the "Blue Train" and operating every 20 minutes or so. Cars are banned from the village's historic centre. It's a swift 35-minute journey, and then a 15-minute (uphill) stroll to the old village. At first, you might wonder what all the fuss is about. Downtown Sidi, around Place 7 Novembre, is an unremarkable modern jumble of supermarkets, hardware shops and cheap sandwich bars. The latter are well worth remembering later, if you're on a budget or in retreat from fellow-tourists. They specialise in brik, deep-fried filo pastries filled with runny yellow egg and either mince or tuna, or takeaway tubs of mechouia, a salad of grilled vegetables.
As soon as you turn the corner for the upward climb, you'll see immediately what makes the village so special. In front of you, the lovely main street (Rue Dr Habib) is a succession of white sugar-cube buildings, with latticed blue balconies overhanging the cobbles and forming an avenue as you walk.
Pink clouds of bougainvillea festoon railings and trail from the tubs or hanging baskets that are scattered up countless small side-streets and alleyways. Directly ahead is the main mosque. And just below the minaret, up a flight of 22 white-edged steps, is the famous landmark of Macke's painting: the Café des Nattes ("Café of the Rush u o Mats"). Its interior is extraordinarily weird and wonderful – cool, dark and fabulously decadent, with elaborate Tunisian water pipe apparatus positioned at strategic points.
Customers sit or recline on rush mats spread across vast stone platforms. These are like four-poster beds, with thick pillars set at each corner. Vividly striped with twisted bands of red and green, the pillars support a low ceiling painted in the same startlingly bright colours. A cross between an opium den and a fairground roundabout, it's like no other café I've come across. In summer, though, the café's clientele stays mostly out of doors. Locals and visitors alike crowd the steps and balconies to drink glasses of traditional thé aux pignons – sweet mint tea with pine-nuts floating on the surface – and to people-watch onto the street below.
By day, Rue Dr Habib is a bazaar – a street hawkers' paradise, thronged with craft stalls and shops full of jewellery, aromatic oils, inlaid boxes, brassware, ornate bird-cages and leatherwork of all sorts. A bonbalouni stall fries and sells the village's traditional sugar-coated doughnuts. Vendors with raffia trays weave in and out of the hordes of shoppers, peddling the ubiquitous miniature jasmine bouquets (bound with twine, and known as a mashmoum) that you'll see many local men wearing tucked behind an ear.
Yet there are still ways to escape the mêlée – even at midday, when the streets are at their busiest. Sidi Bou Said is full of surprises. If you turn right on leaving the Dar Said hotel and follow a winding street upwards, you'll have the place to yourself in minutes. As you climb, you'll start to hear the faraway sound of the sea crashing at the foot of the cliffs. The landscape will become wilder and more exposed, almost like scrub-land. Then, as you ascend to the very highest point of the village, you'll come first to a tiny cemetery of simple white graves and then to the low-built white lighthouse that protects it. It's one of the most peaceful spots imaginable. From there, you can look out and see the whole of the village spread below you – from the ivory domes of the mosque right down to the horseshoe bay of the marina.
The loveliest surprise of all, however, comes courtesy of a former resident of Sidi Bou Said whose life story reads like something out of a novel. Rodolphe d'Erlanger, the French-born son of a wealthy family of merchant bankers, was only 16 years old in 1888, when he first took the steamer from Marseilles. But he was instantly captivated by North Africa and its culture. Abandoning all thoughts of a career in high finance, he went back to Paris to study art, vowing to return as a painter. Some 20 years later, as Baron d'Erlanger – by then a distinguished painter of North African subjects and an even more distinguished musicologist specialising in Arabic music – he returned to Tunisia with his wife and son to permanently settle in Sidi Bou Said.
Baron d'Erlanger left his adopted village a truly extraordinary legacy. His hill-top palace, Dar Ennejma Ezzhara (Arabic for "The Star of Venus"), was completed in 1922. It's open to visitors, not only as a stately home but also as Tunisia's national Centre for Arab and Mediterranean Music. In his later years, when not working on his seminal six-volume history of Arabic music, the Baron devoted his energies to leading a revival of the Arab-Andalucian musical genre known as maluf. He also started to learn to play the qanun, a descendant of the old Egyptian harp.
Nowadays, the palace's peaceful, dimly lit exhibition rooms house his extensive private collection of traditional musical instruments, many of them hundreds of years old and stunningly beautiful. The main recital room and magnificent outdoor balcony provide an exquisite setting for concert performances, all dedicated to preserving the traditional musical forms that the baron championed in his lifetime. In recent years, Dar Ennejma Ezzhara has hosted an annual international "Musiqat" festival each September – a celebration of a unique blend of Eastern and Western music.
No visit to Sidi Bou Said is complete without a visit to the palace. Carved into a niche in the rock face so it wouldn't obstruct the views of more modest homes, it was built with the greatest respect for local heritage and painted in blue and white, which in traditional Islamic art suggest light, sea and sky.
On the afternoon I visited Dar Ennejma Ezzahra there had been a rare shower of rainfall. The place was all but deserted, and I crunched up the wet gravel drive with only a couple of bedraggled birds for company. Inside, the former world of the d'Erlangers comes thrillingly back to life as soon as you step into the enormous entrance salon, with its paintings, exquisite plasterwork and marble fountains. The friendly resident guide greeted me like a long-lost friend and gave a leisurely conducted tour. Room after room is filled with treasures, including mother-of-pearl cabinets, golden bird-cages, Venetian glass from Ottoman times, and a chest said to have belonged to Suleiman the Magnificent. Every nook and cranny of the building is exquisitely carved. Ten master craftsmen worked on its creation, and each of the ceilings is different.
But it was the little things that brought the place to life. On the grand piano there were scores of happy family photographs, all in silver frames. On a corridor wall there was a fine painting of the baron by the Hungarian artist Lazlo. Then, with a conspiratorial wink, my guide recklessly unhooked the red silk rope blocking the doorway to the baron's former studio and we went inside. Even after a morning of rain, the room was flooded with a light so bright that you could see the dust particles dancing. The sea stretched into the distance, a deep cobalt blue from the still-dispersing clouds. Inside the studio, it was as though nothing had changed. Some of d'Erlanger's paintings were stacked against the walls. Others were still on easels. It felt as though the baron himself would walk back through the door at any moment.
The writer travelled with Wigmore Holidays (020-7836 4999; www.aspectsoftunisia.co.uk). Four nights' bed and breakfast in the Dar Said hotel this autumn costs from £645 per person, including flights from Heathrow or Gatwick and transfers to and from Tunis.
Tunis is served by Tunisair (020-7734 7644; www.tunisair.com) from Heathrow and by British Airways (0844 493 0787) from Gatwick.
To reduce the impact on the environment, you can buy an "offset" through the Reduce my Footprint initiative (020-7637 2444; www.reducemyfootprint.travel).
Dar Said, Rue Toumi, Sidi Bou Said (00 216 71 72 96 66; www.darsaid.com.tn).
Dar Ennejma Ezzahra, 8 Rue du 2 Mars 1934 (00 216 71 74 01 02). Open Tuesday-Sunday 9am-1pm and 3-6pm afternoons only in winter; admission TND3 (£1.30).
Tunisian National Tourist Office: 020-7224 5561; www.cometotunisia.co.uk