Escape to the beach or take to the hills? Estoril has a way of nagging at your conscience. The craggy good looks of its coastline are love at first sight, but as soon as you submit to the easy pleasures of the seaside a beguiling alternative beckons from a distance, often half-hidden behind a veil of mist.

The Serra de Sintra, a thickly wooded circuit of hills, rises sharply from the coastal fringe to a height of nearly 500 metres. Nestling among the trees and ferns are some of Portugal's finest palaces and gardens.

Heading north out of Estoril town, the N9 highway narrows into a series of hairpin bends and fleetingly spectacular views, eventually finding its way to the hill-town of Sintra - both a beneficiary and victim of being a World Heritage site. The exquisitely preserved Old Town receives an unending stream of tourist coaches and minibuses. No matter: it must be seen.

The 14th-century Royal Palace is surely the only site on the World Heritage list best known for a pair of chimneys: two giant white conical structures sitting above the kitchens of the royals' summer retreat. Over the years, new buildings and extensions were added haphazardly - Arabesque here, Renaissance there. Modern planners would have disapproved, but a trip to the summit of Sintra's highest peak would have given them apoplexy.

Fortify yourself for another set of hairpin bends with a pit-stop on the steep, narrow street directly opposite the palace. The Piriquita patisserie and coffee shop serves traditional queijadas and travesseiros - sweet pastries much loved by the locals.

How their ancestors must have gaped when something resembling a fairy castle appeared on the southern skyline in the late 19th century - a monumental love-token from the German husband of Portugal's Queen Maria II. The yellow and pink Pena Palace steers a fine line between the heroic and the tasteless. Turreted buildings and buttresses soar above the cliffs, linked by a confusion of stairways and balconies like an Escher drawing that has come to life. The over-furnished rooms provide a fascinating snapshot of the European royals' everyday lives. Twenty five years after Pena was completed, Portugal did away with its royal family, but the palace is presented to the visitor with genuine pride.

After that, it's downhill all the way, as the wisteria-lined road twists towards the open country. At almost every turn, a high wall or gate conceals a palace, hunting ground or formal garden, many of which have been restored for public use. At Monserrate, the exotic garden, contains a lake, waterfall and ruined chapel amid the sub-tropical foliage.

North of Sintra, the N9 leads to Mafra: little town, large palace. In fact, with 860 rooms, it's the largest palace in the country, started in 1717 as Portugal reaped the profits of empire. The corridors are so long that it takes five minutes to walk from the King's apartments to the Queen's. But if you're as tired of walking as King João V must have been, restrict your visit to the fourth floor of the east wing, home of one of the world's great libraries. Forty thousand rare books, painstakingly bound in leather and catalogued by monks, sit on intricately carved shelves that stretch far into the distance. False windows and mirrors ensure that direct sunlight never falls on the fragile volumes. A small colony of bats is encouraged, to take care of the mites that feed on the ancient pages.

The Mafra library is a place of understated beauty and achievement - a more effective tribute to Portugal's former glories than any number of grandiose palaces and fantasy gardens.