HE was a murderous 5th Century AD monarch and a man with audacious architectural ambitions. At first glance it seemed King Kassapa of Sri Lanka and I would have little in common.
However, it turns out the king and I share a common terror of heights. Not that this stopped him from building his palace on the top of a 200-metre outcrop of rock, the Sigiriya fortress in central Sri Lanka. The last part of the climb to his refuge was accessed only by a vertiginous staircase bolted to the sheer rock face.
Apparently in Kassapa's day this was a wooden staircase with a high solid wall so that that the king could not see the drop below him. Unfortunately this ancient staircase was replaced in the 19th Century by a metal structure, also bolted to the cliff but through which are breathtaking views of the surrounding countryside and of, well, nothing but fresh air directly below.
Sigiriya is one of Sri Lanka's eight Unesco-listed World Heritage Sites and is for me, its most spectacular monument, an absolutely vital part of any visit to this country.
In total there are about 1200 steps from the king's beautiful water gardens to the base of Sigiriya rock fortress.
I could pretend that my quickened breathing and racing pulse by the time I reached the top were because of the physical workout, but it was much more the result of plain old fear.
Kassapa built his fortress in just seven years, driven by the need for an impregnable base to ward off attack by his younger brother.
Kassapa was the son of another king, Dhatusena, but his mother was a non-royal consort; his brother Mogallana, however, had royal blood. When the boys' father decreed that Mogallana would be his heir, Kassapa decided on drastic action. He imprisoned and subsequently murdered his father and declared himself king.
His brother, meanwhile, retreated to India to raise an army, bent on returning to reclaim the throne.
It was this threat that lead Kassapa to build Sigiriya. Situating a palace on top of a 200-metre high piece of gneiss rock might have seemed protection enough but Kassapa was not taking any chances - at ground level he added ramparts and double moats. (In times of attack the area between the two moats could be flooded, making an advance even more difficult).
If any army did manage to make it to the base of the rock itself, catapults could hurl boulders down onto the attackers. Apparently the sentry posts at the top were placed in such a way that any soldier who fell asleep on duty would plummet to his death - no doubt this was an excellent incentive to stay alert.
Sigiriya was not just an ingeniously designed military fortress however. Between the moats and the rock are water gardens, complete with fountains that still work during heavy rains, miniature rivers and swimming pools with polished walls.
On the lower slopes of the rock itself Kassapa created boulder gardens which once would have featured wooden pavilions on some of the larger outcrops. There were caves too, decorated with paintings.
The most spectacular of these frescoes remain today. The Sigiriya Damsels are 21 beautiful, bare-breasted women painted on the walls of a rock alcove. To reach this you need to climb about 800 steps from the base. The final stage is up a spiral metal staircase - again not for the faint-hearted.
No-one is quite sure who the damsels are - they might be women from Kassapa's royal court, celestial nymphs or even representations of thunder and lightning.
Back down the staircase the route to the top continues along the Mirror Wall - a three-metre-high barricade constructed on the outside of a ledge that runs around the middle of the rock fortress. This wall was covered with a mixture of egg white, lime, beeswax and honey to provide a mirror-like surface. The wall is covered with ancient graffiti - some from as long ago as the 7th Century - which describe the authors' impressions of the rock, and especially the damsels.
This ledge leads to the Lion Platform, a wedge-shaped piece of flat rock where there is a perfect view of the metal staircase that leads to the palace ruins on the summit. In Kassapa's day the base of the wooden staircase was entered through the mouth of a massive statue of a lion. Today only its giant paws remain.
It was at this point that I considered a dignified retreat. The staircase, with its open metal treads and metal railings, zigzagged up the cliff face for a dizzying 400 or so steps.
There was, at the time, a constant stream of people going up and down. It would be bad enough to freeze in terror half way up, worse still to create a traffic jam while someone worked out how to prise my fingers from the railings and get me down.
Thankfully, two friends were on hand to engage me in idle conversation on the way up and to make the occasional suggestion not to look down. I didn't need to be told twice.
It was worth the effort - the view from the top is stupendous - on one side the king's pleasure gardens stretch away to the jungle fringes, on the other side is the Sigiriya tank (a man-made lake) which once supplied the fortress and palace with its water.
The palace ruins are now mostly retaining walls and foundations. No one is exactly sure of the exact functions of the various spaces, though the king's residence would probably have been at the highest point and the servants' and soldiers' living quarters on the lower levels.
There's a large tank hewn from the rock and a throne from where the king could survey his kingdom in the distance - and quite likely his dancing girls in the foreground.
What is also a mystery is why, having created what must have been an impregnable fortress, Kassapa didn't stay safely up here when his brother Mogallana finally arrived with his army in 495AD.
Instead, he descended, mounted an elephant and rode into battle. His elephant bolted, his own army fled and Kassapa, rather than being captured or killed, fell on his own sword.
New king Mogallana didn't retain Sigiriya as his capital, preferring instead to live at Anuradhapura, which had already served as royal city.
He gave the fortress back to a community of monks whose predecessor had apparently first colonised the caves on the lower levels as far back as the 3rd Century AD.
Maybe Mogallana suffered even worse vertigo than his brother.
Update your news preferences and get the latest news delivered to your inbox.