Hyderabad was India's Shangri-la, a land of palaces and harems ruled by a mad and monied despot. WILLIAM DALRYMPLE uncovers its diamond-studded, djinn-soaked past

"Fibs," said Mir Moazam Hussain. "That's what every one of your generation thinks I'm telling, at least when I talk about Hyderabad in the old days. You all think I'm telling the most outrageous fibs."

The old man settled himself back in his chair and shook his head, half-amused, half-frustrated: "My grandchildren, for instance. For them, the old world of Hyderabad is completely inconceivable: they can barely imagine that such a world could exist."

"But what exactly can't they believe?" I asked.

"Well the whole bang-shoot really: the Nizam and his nobles and their palaces with their zenanas (harem) and the entire what-have-you that went with the Hyderabad state."

Mir Moazam is a sprightly and intelligent 84-year-old, with a broad forehead and sparkling brown eyes. "Take the palace I grew up in," he continued. "It was by no means the biggest but it had a staff of 927 people, including three doctors. There was even a regiment of African women who were there just to guard the zenana. But tell that to my grandchildren. They've seen how we live today, and they just think that I'm making it up. Especially when I start telling them about my grandfather, Fakrool Mulk. He was a remarkable man, a great servant of the state, but he was also - how shall I put it - a larger-than-life character."

"Tell me about him."

"Well, where shall I start? You see, although my grandfather was deputy prime minister in the Nizam's government, his real passion was building. Over the course of his life, he built this great series of vast, rambling palaces, but he was never satisfied. As soon as he had finished one, he immediately began to build another. Sometimes he would just give an entire palace away. Of course, he built up enormous debts in the process."

"Was he a trained architect?"

"Well, that was precisely the problem. No, he wasn't. But every evening he would go out for a walk, and with him he would take his walking stick and this great entourage of his staff, which always included his secretary, his master mason, his builders and a couple of his household poets - some 30 or 40 people in all.

"Anyway, on these walks - when the inspiration came - he would begin to draw in the sand with his walking stick; maybe a new stable block, or a new palace, according to how the fancy took him. The draughtsmen he had brought with him would jot it down on paper and then draw it up when they got back. Well into his seventies he was still adding new wings to his palaces."

"Did he have a favourite palace?"

"The one he lived in the longest was Iram Manzil. It wasn't the largest, but the reason he really loved it was the stuffed tiger."

"The stuffed tiger?"

"You see, after building, my grandfather's other great love was tiger shooting, and the season for shooting tigers was only a few months each year. So, on the hill outside Iram Manzil, he built this railway track and on the track he placed a stuffed tiger on wheels. It would be let loose from the top of the hill and we would all line up and let fire with our double-barrels: bang! bang! bang! All of us aiming at this wretched tiger as it careered down the hill. By the time it reached the end of the track it was blown to bits, poor thing. So the men who were employed to look after the tiger would patch it up and pull it back up, and off we'd go again.

"But, like my grandchildren," added Mir Moazam, looking me in the eyes, "you probably find it difficult to conceive the life I'm describing. And why shouldn't you? This entire world was almost completely uprooted years before you were born."

But I did believe Mir Moazam, for I had long heard equally fantastical stories about Hyderabad, which was, until 1948, a huge, autono-mous princely state in central-southern India.

YEARS AGO, Iris Portal, an old friend of my grandmother, had told me how, one day in the late 1930s, she had been taken to see some of the Nizam's treasure. One of the Hyderabadi princesses had led Iris to a series of open-fronted sheds in the grounds of one of nine palaces, past a group of Bedouin Arab guards all lolling about half-asleep in a state of dishabille, and there at the back of the sheds was a line of trucks. The trucks were dusty and neglected, their tyres rotting and sinking into the ground, but when the two ladies pulled back a tarpaulin, they found that the trucks were full to the hilt with gems and precious stones and pearls and gold coins. The Nizam apparently lived in fear of a revolution and had equipped the lorries so that, at short notice, he could get some of his wealth out of the country if the need came. But then he lost interest and left the lorries to rot, quite incapable of being driven anywhere, but still full of their jewels.

For all the fairy-tale quality of these stories, I soon discovered that they were confirmed in every detail by the most sober history books. The Nizam, Osman Ali Khan, did indeed possess the largest fortune in the world: according to one estimate it amounted to at least Pounds 100m in gold bullion and Pounds 400m in jewels, many of which came from his own Golconda mines, source of the Koh-i-Noor. For the first half of the 20th century, the Nizam ruled 15m subjects and a state the size of Italy as absolute monarch, answerable (in internal matters at least) to nobody but himself. Nor was Hyderabad a poor country: in its final year of existence, 1947-8, the income of the state rivalled that of Belgium and exceeded that of 20 member states of the United Nations.

Fragments of this lost world still survive as you drive through the city today. New buildings are mushrooming everywhere, often built over the old Indo-Islamic bazaars and the colonial town houses. But look a little further and you soon discover that many small pools of the old Hyderabad are still completely intact.

The Falaknuma Palace is one such place. A huge complex of white classical palaces raised above the town on its own acropolis, the Falaknuma was the principal residence of the sixth Nizam. But, today, it is subject to a bitter legal dis-pute and the entire palace complex lies empty, locked by court order, with every doorway sealed by red wax. Wipe the windows and peer inside and you see cobwebs the size of bedsheets hanging from the corners. The skeletons of outsize Victorian sofas and armchairs lie dotted around the parquet floors, their chintz entirely eaten away by white ants, so that all that remains is the wooden frame, the springs and a little of the stuffing. Beyond are long, gloomy corridors, leading to unseen inner courtyards and zenana wings, mile upon mile of empty, classical arcades and melancholy bow fronts, now quite empty but for a pair of lonely chowkidars (guards) shuffling around with their lathis (long sticks) and whistles.

That this fairy-tale extravagance has always been part of the culture of Hyderabad is demonstrated by the Qutb Shahi tombs, a short distance to the east of the Falaknuma. They are wonderfully ebullient monuments dating from the 16th century, with domes swelling out of all proportion to the base, each like a watermelon attempting to balance on a fig. Above the domes rises the citadel of Golconda, source of the ceaseless stream of diamonds that ensured that Hyderabad's rulers would never be poor. Inside the walls, you pass a succession of harems and bathing pools, pavilions and pleasure gardens - a world that seems to have jumped straight out of the pages of the Arabian Nights.

This oddly romantic and courtly atmosphere infected even the sober British when they arrived in Hyderabad at the end of the 18th century, and the city became the location of one of the most affecting of Anglo-Indian love stories. The old British Residency, now the University College for Women, is an imposing palladian villa that shelters in a fortified garden in the south of the town. The complex was built by James Achilles Kirkpatrick, who, shortly after arriving in Hyderabad, fell in love with Khair-un-Nissa (Excellent Among Women), a great-niece of the dewan of Hyderabad, whom he married in 1800 according to Muslim law.

I found a battered token of Kirkpatrick's love for his wife surviving today in the garden at the back of the residency. As Khair-un-Nissa remained all her life in strict purdah, living in a separate bibi ghar at the end of Kirkpatrick's garden, she was unable to walk around the side of her husband's great creation to admire its wonderful portico. Eventually, the resident hit upon a solution and built a scaled-down plaster model of his new palace for her, so that she could examine in detail what she would never allow herself to see with her own eyes. The model survived intact until the 1980s, when a tree fell on it, smashing the right wing. The remains of the left wing and central block now lie under a piece of corrugated iron, near the ruins of the Mogul bibi ghar , buried deep beneath a jungle of vines and creepers, in an area still known as the Begum's Garden.

Another legacy of Old Hyderabad to filter down to the modern streets is a fondness for witchcraft and sorcery. In the Lad Bazar, a short distance from the Charminar, I found a shop that sold nothing but charms and talismans: silver ta'wiz blessed by Sufis, special kinds of attar that deflected the evil eye, nails worried into the shape of a cobra to protect from snake bites. On one side of the shop were piled huge bundles of thorns: "Put them at the entrance of your gate along with a lime and a green chilli and it will take on any bad magic," said Ali Mohammed, who ran the shop.

"Do you really believe they work?" I asked.

"Definitely," said Ali Mohammed. "I have seen it for myself. The murshad (sorcerers) of Hyderabad are very powerful. They can kill a man with a look if they want to."

"Magic? Oh yes, there was no shortage of magic," said Mir Moazam's wife, the Begum Meherunissa, when I told her about my conversation in the bazaar later that afternoon. "In the time of the Nizam, there were many such stories. On summer evenings, the womenfolk of my family would go for a stroll in one of the gardens. One day, after we had returned, my aunt began to behave very oddly, and there was this smell of roses wherever she went. Luckily, my grandfather realised what had happened. He called a mur shad , who questioned my aunt. Quite suddenly, she started speaking with a man's voice, saying, 'I am the djinn of the rose garden and I am in love with this woman.' The murshad performed an exorcism and the djinn was sent off. After that, the murshad became a regular visitor. He could work small miracles."

"You saw him work miracles?"

"Many times. Or rather not him so much as his djinn."

"He had his own djinn?"

"That's right. To master a djinn you must first fast for 40 days. Very few succeed. But this man succeeded and the djinn gave him the strong powers. The children of Hyderabad all knew him as Misri Wallah Pir (the Holy Man Who Gives Sweets) and they would run after him and shout, 'Pir, sahib, give us sugar.' So he would bend down and pick up a handful of mud and throw it and, before it reached us, midway in the air, it would turn to sugar. It was delicious: clean and white, with no sand or impurity. My mother was very angry when I told her I had eaten some of Misri Wallah Pir's sugar, and said that it would become mud again in my stomach. But it never did me any harm."

"So you saw him turn mud into sugar more than once?"

"Often. We children would follow him around and spy on him. Once, my friend asked Misri Wallah Pir for some biryani. Pir sahib said, 'I am a poor man, how can I afford biryani?' But we pleaded with him and eventually he called his djinn - ' Idder ao Mowak hal !' ('Come here, spirit!'). And, within seconds, a delicious biryani appeared before us out of the thin air.

"Another time, a sick man begged him for grapes. It was not the season, but the djinn brought them all the same."

"But, you see, everything changed after the independence," said Mir Moazam, who had listened to his wife's story. "After the Indian army invaded and toppled the Nizam in 1948, that whole world collapsed. I left for Paris to work with Unesco and barely recognised Hyderabad when I returned 20 years later. Almost all the great houses had gone. The aristocracy lost their status and their income after the fall of the Nizam, so they sold everything - land, houses. They knew nothing about business, selling their heritage was the only way to make ends meet."

The old man took my hand: "My children tell me you mustn't live in your memories. And they are right, of course. That is why I never go back to the old palaces where I spent my childhood. At every step there are fragments of history. And, frankly, it breaks my old heart to see them as they are today."

* William Dalrymple travelled to India as a guest of Greaves Travel (0171-487 9111). His new book, The Age of Kali: Indian Travels & Encounters, is published by HarperCollins