When you're having a midlife crisis, you don't want a crowded resort. Tony Kelly finds peace of mind in the cool of a monastery

Where do you go to recover from a mid-life crisis? A long trek in the Himalayas? A remote Scottish island? A Harley Davidson ride across America? Or how about Mallorca?

The home of the package holiday may not be everyone's idea of a cure for a troubled soul, but away from the resorts there is another Mallorca, a place of mountains and fertile countryside, vineyards and almond groves. There are also hilltop sanctuaries where travellers can spend the night. Most of the monks have left but the monasteries remain, offering simple rooms in the old monastic cells.

Accommodation is basic. You have to make your own bed and you may not always get a shower, but with prices ranging from €10 to €25 (£7 to £17) per night, what do you expect? What the monasteries lack in comfort they make up for in views and in that increasingly rare quality, solitude.

Not far from Palma airport, Puig de Randa rises out of the central plain, its summit disfigured by unsightly radar masts. It was here that the Mallorcan mystic Ramon Llull retired in 1275 to found his first hermitage as a result of his own mid-life crisis. A wealthy courtier in Palma, he enjoyed a life of wine, women and song until an incident at the age of 40 left him seriously questioning his morals. Chasing a married woman on horseback through the streets, he followed her into church and down the aisle, whereupon she lifted her blouse to reveal disease-ridden breasts. Much chastened, he fled to Randa where he wrote books on metaphysics and eventually became a missionary before being stoned to death by angry Muslims in Tunisia.

Halfway up the mountainside, I stopped at Ermita de Sant Honorat, a former hermitage, now a home for retired priests. In the church porch, a pilgrim's prayer seemed to reflect my situation:

Set out!
You were born for the road.
You have a meeting to keep.
Where? With whom?
You don't yet know.
Perhaps with yourself?...
Your head does not know where your footsteps are leading your heart.

Reaching the summit, I passed through a 17th-century doorway and rang the bell of the monastery of Our Lady of Cura. The caretaker showed me to my cell in the corner of the courtyard, with an image of the Virgin above the bed and a window opening to reveal wide views of the plain, a patchwork of green and brown fields and the island of Cabrera shimmering across the sea. As the sun dipped below the mountains and the sky caught fire, I ate my picnic on the terrace, watching the lights come on in the busy resorts around Palma but all alone in another world.

A short distance away in Petra, the sleepy village of ochre houses is much as it was when another Mallorcan hero, Junipero Serra, grew up here in the 18th century. His birthplace has been turned into a museum and the street leading to the house is lined with ceramic plaques depicting him baptising native Indians in his Californian missions, which grew into the cities of San Diego and San Francisco. On a hill above the village is Ermita de Bonany, where Serra preached his last sermon before departing across the Atlantic. The church was built by villagers in 1609 to give thanks for a bon any (good year) of harvest after they made the pilgrimage up here during a drought to pray for rain.

At the sanctuary of Puig de Maria above Pollenca, I finally got chatting to some of my fellow pilgrims. Conal was an Irish playwright who had come to Mallorca to work; Lucy and Viv, from Wales, were busking around the island. Long after midnight, I followed the cool corridor to my cell, where a notice reminded me to Respectem El Silenci. I slept for hours and woke to find the sun flooding through the window and bouncing off the blue Mediterranean below.

Lluc monastery, in the Tramuntana mountains, is Mallorca's holiest shrine, a traditional honeymoon destination and a popular place of pilgrimage even for those who are not conventionally religious. Like many such places, its origins revolve around the story of a sculpted Virgin, hidden in a cave after the Moorish invasion and discovered by a boy tending his sheep. The statue, La Moreneta (the little dark one), now sits in a Renaissance chapel, encrusted with precious stones. Twice a day the choirboys perform, the first time for coach parties up from the coast, the second time at dusk for those who are staying. This is hardly a solitary experience - the monastery resembles a small village, with shops, banks and restaurants and you sleep in a modern pilgrim block with en suite bathrooms - but there are peaceful walks in the mountains and valleys where the silence is broken only by sheep bells.

For real solitude I headed for the village of Orient, where I left my car and climbed for an hour through the olive groves to reach a mountain pass. From here, a steep path led up to the ruined Moorish castle at Alaro and beyond that to a small sanctuary, Nuestra Senyora del Refugio, founded in 1622. The tiny chapel had tiled walls, stuccoed ceilings, an altar carved from marble and ex votos left by previous visitors. From the terrace, I could make out almost the entire island.

At 8pm the donkeys were loaded up and sent down to the road for provisions. When they returned an hour later, the caretaker rustled up bread and ham with sharp green olives and a jug of red wine from the barrel which I shared with an Austrian couple and a young Swiss woman. The sun set behind the mountains. Donkeys were braying and trees were whispering in the breeze. I realised how the chapels, candles and holy water reminded me of my Catholic childhood but how the real sense of a sacred presence was to be found in these mountain landscapes. I remembered some more words from the pilgrim's prayer at Sant Honorat: "And at the end your silence will speak to you." I felt more at peace than I had for ages.

Tony Kelly flew with easyJet (0870-6000 000; www.easyjet.com) from Stansted to Palma, which offers return fares for £110 in July. Monasteries: Santuari de Cura (00 34 971 660994), Ermita de Bonany (00 34 971 561101), Santuari del Puig de Maria (00 34 971 184132), Santuari de Lluc (00 34 971 871525), Nuestra Senyora del Refugio (00 34 971 182112). Booking advised. Food is available at all the monasteries except Ermita de Bonany.