Cairo's English sphinx

Even by Cairo's standards, the mosque of Ibn Tulun is a rare gem. Dating from the ninth and 10th centuries, it has a rare detail - a spiral staircase snaking around the outside of its minaret.

All around it are buildings many centuries younger, mostly lamentable things from which satellite dishes sprout and washing billows in the dust-laden air. The streets appear to have been cratered by a retreating army; cats nose through rubbish festering in the gutter; goats teeter around the roof of a low-rise block of flats on which, for some reason (or none), they have been tethered.

Obeisance paid to the mosque, you may consider your visit over. But pause to study a structure of crumbling, biscuit-coloured brick, seemingly a series of rectangular blocks, which might be (but which is not) an adjunct to the mosque.

A clue to its history is offered by the mashrabi screens which cover its windows - intricately carved wood, artfully designed to admit as much light as possible, without exposing those within to the gaze of those without. Inside, there is a Persian Room, a Queen Anne Room, a Damascus Room, a Harem Room - deserted, regrettably, but embellished by extravagantly decorated ceiling beams, and equipped with a huge brown censer, which was presumably wafted around to get the girls in relaxed and accommodating mood.

There is an alabaster table, a Koranic inscription carved into its rim; there is a corner cupboard which swings open on the release of a hidden catch, and leads to a gallery (more mashrabi screens) above the Celebration Hall. There is a "Birthing Room" - next to a Marriage Room - complete with birthing chairs, which have slightly more than a semi-circle cut from their seats. There are gaudy chandeliers, and a Turkish Room with gilded Louis XV chairs and cabinets filled with blue and gold decanters. It is the sort of place which could be a setting for a Bond movie (and it has been, for a couple of scenes from The Spy Who Loved Me).

This is the Gayer-Anderson House - more exactly, two adjoining houses, part 16th century, part 18th, three storeys and 36 rooms of unbridled, but educated, eccentricity - the achievement of Major Robert Grenville Gayer-Anderson.

The major had a rewarding career, much of it spent wearing long shorts in the desert (he was seconded to the Egyptian army for a decade, 1907-1917), serving in the Tagoi Punitive Expedition, 1910 (for which he was mentioned in dispatches). After the First World War (another mention in despatches; honourable wounds) and retirement from the Army, he decided to stay on in Egypt, becoming Oriental secretary to Allenby, but within a few years he had abandoned that, too, and spent most of the rest of his life collecting, in Persia and Syria, as well as Egypt. Finally leaving his adopted country in 1942, he bequeathed his house to the Egyptian nation; King Farouk rewarded him by granting him the honorary rank of lewa - major general - as well as bestowing on him the title of Pasha.

Unfortunately, subsequent Egyptian regimes were unable to do justice to the major's bequest. Attempted improvements have had unhappy results: CCTV cameras were installed but abrasively at odds with their surroundings (these days, they remain in situ, but have long ceased to function). Additional lighting has been provided by bulky spotlights; smoke detectors have been slotted in with no apparent attempt at disguise; antique cabinets have been screened with plastic. Outside, a new tourist police block has been built, its design apparently entrusted to a superannuated East German border guard. What purports to be a south-facing garden is a municipal wilderness - school of Lambeth, perhaps Hackney - lacking a scrap of shade.

Add to that the fact that 2,000 books, some of them dating from the 16th century, have been slung haphazardly into cupboards - and the fact that the marble surrounding the fountain in the Celebration Hall has cracked and chipped - and the major's creation seems doomed.

Help, though, is at hand. A comprehensive restoration scheme is under-way, with donations from companies such as BP Amco, as well as from the British-Egyptian Business Association and the British Embassy helping to meet the cost, which runs to hundreds of thousands. Welcome though this undoubtedly is, it may induce a pang of anxiety in those bewitched by the house's peculiar spell. Gayer-Anderson permeates its walls - as well as looking down from them: in one drawing he is shown as the Sphinx - so much so that it feels less like a museum than a house from which he slipped out a while ago, but to which he may, somehow, return.

It would be sad if, during the inevitable sanitisation of restoration, G-A were to be airbrushed into oblivion. There seems little chance of this. Nicholas Warner, the Englishman in charge of the project, suggests the house could be an irresistible backdrop for theatrical events, and intends to plant jacaranda, hibiscus and carob in its garden, and to mask the tourist police office with jas-mine.

But he reveres Gayer-Anderson's eccentric genius. Meanwhile, there is the work of the house's subsequent custodians to contend with. "There are about 80 fire extinguishers [lodged, for some reason, in the marriage room]," says Warner. "And there are 65-year-old mattresses - they've kept everything."

On hand to help him is Theo Gayer-Anderson, the major's grandson, now living in Egypt and immersed in conservation work. Flicking through a family album, Theo displays a series of photographs of his grandfather, obviously taking a keen interest in the welfare of the natives - all fit, young, dusky and male. The final photograph shows an attractive woman; a trace of melancholy in her eyes perhaps? This, explains Theo, was his grandmother - with whom his grandfather spent just one night of his life. Future generations should be lucky enough to see the Gayer-Anderson in restored glory, but few will feel as fortunate as Theo Gayer-Anderson, who is grateful to be around at all.