WHEN I finally reached the top of the minaret, stuck my head out and saw the shining towers, turquoise domes, massive walls and mudbrick homes of the ancient city of Khiva spread out before me, I almost swooned.
Unfortunately, that wasn't because the view was spectacular - though it was - but because of the precarious nature of the platform provided at the top for the muezzin to call the faithful to prayer.
There was just a small circle of concrete about a metre in circumference, much of which was taken up by the hole for the circular staircase I had just emerged from, and on all fours sides there were bare openings.
I don't normally suffer from vertigo but as I looked out, conscious that if I took a misstep there was nothing to stop me falling to my doom, I definitely felt a bit dizzy.
My equilibrium wasn't helped by the thought that I still had to climb back down that steep narrow staircase, its steps so worn by time that I had to use hands as well as feet to maintain my balance, the ceiling so low I had to climb bent over and for much of the time in darkness.
Oh, and did I mention that the minaret, part of the 200-year-old Sayid Sholkobbiy Mosque, was leaning at quite an angle?
There are towers in Khiva that are taller and more accessible but I was looking for one on the eastern side of the town so as to take advantage of the morning light. Then I saw this leaning minaret which seemed to be in the right position and tracked it down just outside the city walls.Still, I had got what I wanted, a good view of this superbly preserved Silk Road town in Uzbekistan.
It seemed to sprout from a small mosque so I peered through the open door to check if it was okay to enter and whether I could climb the minaret. Inside an elderly man with a white beard and a forbidding expression was sitting cross-legged before a low table eating a meal.
I started to back off but then a younger man appeared and gestured that I could come in. I took off my sandals and began to enter when he said, "Minaret?" I nodded and he signalled that I could put my sandals back on.
How much? "Two thousand." That was two thousand sum - or a bit over $1. Done. I handed over the money and he opened a worryingly small door in a corner of the mosque. Inside I could see the start of a spiral staircase, obviously the entrance to the minaret, so I started to climb. And it was well worth the effort.
From the top I could see almost the full 2.5km sweep of the massive mud and brick walls of Khiva, mostly dating from 300 years ago, when they were rebuilt after being destroyed by an invading Persian army. These days the walls are surrounded by a scruffy modern town but beyond its sprawl I could see the orange emptiness of the fearsome Karakum desert.
Right in front of the minaret was the city's East Gate, an ornate structure with an open space in front where, according to Lonely Planet's Central Asia guide, the notorious Khiva slave market used to be held. I had already seen the niches where the slaves were apparently held awaiting sale, these days mainly occupied by women selling drinks.
Behind the gate soared the mass of minarets, turquoise domes and superbly tiled frontages which marked the town centre, once bustling with warriors and officials of the ruling khan, traders and slaves - as many as 30,000 at any one time - but now primarily serving as souvenir shops and museums.
I recognised the dome of the huge mausoleum built by the townsfolk to honour Pahlavon Mohammed, a 14th century character who seems to have been an amazing combination of champion wrestler, outstanding poet, inspiring philosopher and cunning trickster who used his wit to outsmart the mighty on behalf of the meek.
So beautiful is his tomb - which locals still visit to leave offerings and ask for help - that the ruling khans promptly commandeered it for themselves, so the beautifully tiled central dome is now occupied by Mohammed Rakhim II, who ruled from 1865 to 1910, with Pahlavon relegated to a side chamber.
I couldn't miss the tallest of Khiva's many minarets, at 45m towering well above the one I was perched on, part of the Islom-Huja Medressa, built a hundred years ago to commemorate a liberalising grand vizier who was promptly assassinated by the khan and the clergy.
Nearby was the distinctive blue shape of an unfinished minaret, planned to be the highest of all at a massive 70m, but cut short at barely a third of that when the builder died.
And on the far side of the town loomed the great bulk of the Kukhna Ark, the fortress home of the ruling khans, with imposing battlements, lofty watchtower, a delightfully tiled pavilion where the khan of the day dispensed justice, and a small, grisly prison where those who earned his displeasure were tortured and had their throats cut.
Of course, from this vantage point my experience of these beautiful old buildings was a bit detached and, in a way, that's what the centre of Khiva is like: it's spectacular and marvellously preserved but a bit sterile.
But, fortunately, surrounding the tourist-oriented heart is a maze of alleyways where people still live much as they have for generations, albeit with the odd satellite dish or car added.
As I made my way to this minaret, for instance, I had paused at the south gate to watch an old woman in a black headshawl bringing two sheep on leads back from their early morning grazing outside the walls. A few moments later three youngsters arrived pushing a pram piled high with grass to feed their animals.
Just inside the gate, a woodworker was opening up shop, putting out walking sticks and intricately carved picture frames for sale, then he and his young son got busy with their hammers and chisels.
Further down the same lane a clanging sound from a cellar signalled a blacksmith was busy shaping a piece of metal into something useful.
Two small boys passed by, leading two more sheep back from grazing. Round the corner, under a tree, two men were busy butchering a less fortunate sheep.
As I neared the town centre a group of men were sitting quietly on the porch of a large house. It turned out they were conducting a wake. A few houses down a woman was sitting outside her house, boiling water to be used to wash the body.
In front of several houses women were sitting knitting. A keen handcraft worker in our group who investigated discovered they were knitting socks. "They knit a sock a day and they charge US$1 a sock."
In a park loomed a huge statue of al-Horezmi, the founder of algebra, and in many ways of modern arithmetic, with two small boys climbing cheekily over his bronzed bulk. You wait, I thought, he'll have his revenge in the classroom a few years from now.
Needless to say you couldn't see that sort of thing from high up in a leaning minaret so I decided it was time to make the tricky climb down. Back at the mosque the imam was still eating his breakfast and ignored my presence but the young man who had let me in smiled and gave a thumbs up.
Outside, who should I bump into but Ramil, our guide, who was taking another member of the group to buy a sim card for her mobile phone.
Seeing me emerge he looked surprised. "Have you been up that minaret?" he asked. "Did they let you climb it? That's a working mosque. The prayers you would have heard sounding across the city this morning would have come from here. Did they let you in?"
When I outlined my adventure he looked even more amazed. "Well that's something new.
"James" - he called me James because that's the name in my passport - "in the 10 years I've been bringing tours to Khiva I've never had a tourist who would be willing to go up that minaret. You are the first."
Afterwards, walking round the great walls of Khiva back to our hotel, I came across a young boy and girl supervising a couple of sheep feeding on a thin strip of grass at the base.
Photo, I asked, pointing to my camera? The girl, who was the oldest, nodded so I took a picture.
Then the boy piped up. "Pen?"
Hmm. I did have a pen on me but it had a certain sentimental value, having been handed out by a friend to mark the completion of a lifelong research project. But I had other more disposable pens back at the hotel a couple of hundred metres away.
I tried to indicate that I would go and get a pen but clearly the message didn't get across, or they didn't believe it, and their little faces fell.
When I returned about 15 minutes later and asked, "Anyone want a pen," they at first looked amazed, then smiled and sprinted towards me, leaving their sheep briefly unattended.
There was a purple pen for the girl and a black one for the boy. I have given out pens before but I've never seen them produce as much delight as in this pair.
They posed, grinning broadly, for another photo and then turned to examining their gifts. When I left they were busy playing with the pens and talking excitedly ... and the sheep, totally ignored, grazed contentedly on.
Update your news preferences and get the latest news delivered to your inbox.