When Selim the Sot ascended the throne of the Ottoman Empire in 1566, he proposed a new theory of royal governance. Henceforth the greatness of an emperor was to be judged not by bravery or glory, but by indulgence in comfort and pleasure. In Selim’s case this meant two things — women and drink. It was the kind of wheeze that modern leaders can only dream about.

I blame the Topkapi Palace. It seemed to have this corrupting effect on all its inhabitants. Its fragrant luxuries did not exactly encourage effective government. Once Selim had moved himself and his harem of 150 women into the Topkapi, he never seemed to want to come out again. In 1573 the French ambassador noted that in three months Selim had only left the palace twice, and that was to nip next door for prayers. What was it about this palace above the Golden Horn that seemed to cast such a spell over its princes? I hurried along to find out.

For outsiders, entrance to the Topkapi Palace was never easy. In the old days European ambassadors, who were kept waiting for weeks, vied with one another for admittance to the reception halls of the Ottoman sultans. Little has changed. In the Court of the Janissaries, I found myself in an interminable ticket queue vying with a busload of Italians to whom queuing did not come naturally. After twenty minutes I realised I was going backwards. When I finally fought my way to the ticket window, I was surprised to find it was level with my shins, obliging me to kneel and genuflect slightly to ask for an adult single.

The Topkapi sits astride the best real estate in the city, overlooking the Golden Horn, the Bosphorus and the Sea of Marmara. Walled and secluded, it is a city within a city where, for four centuries, the Ottoman Sultans were pampered and indulged in a series of salons and pavilions that came to be known as Dar-us-Saadet, or the House of Felicities. Once through the gates, I began to feel the Selim effect. Between the splashing fountains and the swirling tilework, it suddenly seemed a good day for doing nothing.The palace is onion layered, with a succession of gateways leading deeper into further courts, in a progression from public to private. From the Court of the Janissaries, I passed through the Gate of Salutations into the Court of the Divan. In the Imperial Council Chamber in the Second Court gilded bars were set into the wall. From behind these the Sultan watched government proceedings, more a prisoner than a ruler.

In the Treasury in the Third Court I examined the famous Topkapi Dagger with its emerald-studded handle, and the Kasikci Diamond, the world’s fifth largest, found on a rubbish tip and purchased by a lucky street peddler for three spoons. Across the courtyard I inspected the imperial portraits. They began with Mehmet the Conqueror, at the end of the 15th century, who looked like a conqueror, and ended with Abdul Hamid II at the beginning of the 20th, who looked like a dishevelled ship’s steward.

As if to emphasize its separateness, the harem involved another ticket queue. Prices seemed a trifle steep but I shouldn’t complain. A hundred years ago, entrance to the harem would have cost me my testicles so twenty bucks should probably be considered a bargain. Some remnant of Ottoman security was still attached to the place, and visitors are not allowed to wander at will in the complex. The guide, a man with a permanent smirk, herded us inside in a carefully marshalled group. Bringing up the rear were two burly guards, like latter-day eunuchs, to ensure that no one strayed.

There are 400 rooms in the harem. It is a vast and bewildering complex of labyrinthine passageways, domed chambers, galleried arcades, cloistered rooms, grand salons, and intimate courtyards. The outside world intrudes only as a view through screened windows, or as squares of sky above the courtyards.

The guide led us through the eunuch quarters — a mere 50 rooms — to the courtyard of the Sultan’s Mother, the nominal head of this female world. Passing through marbled bathhouses, we arrived in the domed Imperial Chamber where the Sultan held banquets and enjoyed evening entertainment, and then in the Chamber of Murat III, the son of Selim. Gorgeous Iznik tiles swarmed across the walls between a bronze fireplace to warm the room in winter and a marble fountain to cool it in summer.

While the rest of the group were examining the architectural details, the guide sidled up to me. He had noticed I was taking notes. He had the bug-eyed look of a family retainer keen to share a few royal secrets in exchange for envelopes of well-thumbed cash. Perhaps he thought I was from the National Enquirer.

“Murat’s wife,” the guide whispered. “She was jealous.’

I must have looked surprised. A jealous wife would have gone mad in the harem.

“Murat was not like Selim, his father. Murat had only one wife when he came to the throne,” the guide said. “Safiye. He loved her. But others were wanting to diminish her influence. So they were always presenting him with new womens for his harem. For a long time he was ignoring them.”

We had arrived in the Apartments of the Princes where the Sultan’s sons were confined until their mid or late teens. Theirs was a precarious existence. When one of their brothers ascended the throne, the rest were usually strangled with silk cords by deaf mutes, unable to hear their cries.

The guide was doggedly pursuing his story. “But finally Murat’s sister found a woman to tempt him, a slave girl.” He gripped my arm. “Once he has tasted her, pheettt”– he made a sound like a firecracker fizzing — “the floodgates opened. He could not get enough womens.”

Writing in the 1580s, the Venetian envoy described Murat’s conversion. “He tried out many beautiful young girls and his life changed. Every night he sleeps with two, and often three… They fear his health is in danger.” The Topkapi had won. Murat too became a slave to pleasure. During the last years of his life, he fathered 54 children. He died in 1595, worn out but happy at the age of 48.

Selim’s grandfather, Suleyman the Magnificent, was one of the rare exceptions to the usual Topkapian decline into decadence. To his subjects, his obsession with Roxelana, who had been bought as a slave in the Istanbul market, seemed so unnatural that they feared she had cast a spell on him. To later generations it was one of the great Ottoman romances, fuelled by the poetry that the two wrote to one another. Their tombs now stand side by side in the cemetery of the Suleymaniye, the mosque that is Suleyman’s great monument to the city.

Roxelana’s great monument is the baths that still bear her name, opposite Haghia Sophia. The hamam was the center of women’s social life in Ottoman times. It was an opportunity for them to get out of the house and to let their hair down in steamy luxuriance away from the eyes of men and eunuchs. For a husband to deny his wife access to the hamam was grounds for divorce.

For the women of the harem it was also an excuse for physical intimacy, a rare experience when you have scores, possibly hundreds, of rivals. Luigi Bassano da Zara, an Italian who served as a page in the Topkapi in the 16th century, reports that “as a result of familiarity in washing and massaging one another, women fall in love with each other… I have known women, seeing a lovely young girl, seek occasion to wash with her, just to see her naked and handle her…”

Eager to experience Istanbul undressed, I hurried along to the great Cemberlitas Hamam, hard by the Grand Bazaar. The baths are segregated, so sadly I wasn’t going to get to glimpse women “naked and handling one another.”

Prices seemed a trifle steep but I shouldn’t complain. A hundred years ago, entrance to the harem would have cost me my testicles so twenty bucks should probably be considered a bargain.

In the hararet, the central steam chamber, I stretched out on the gobektasi, the round marble platform, heated from below, where customers lie like eggs on a griddle. Everyone wore a pestemal, a checked cloth, round the waist. In the male section, at any rate, it is impolite to flash. Round the marble walls were basins with hot and cold running water to sluice over oneself. Above me the dome was pierced with small holes through which light streamed in steamy shafts.

I was roused from my reverie by the arrival of my masseur. Naked but for his pestemal, Mehmet had a moustache the size of a baseball bat, a shag pile chest and shoulders that would have made the Hulk seem elfin. He attacked me with a scrubbing flannel. His method was to massage what construction work was to ballet. After a thorough soaping, followed by buckets of hot and cold water, he began to twist my limbs into positions that neither God nor I ever intended.

Post-bath I collapsed in my private cabin with a glass of sweet tea. The harem must have been like this: a good seeing to, then a cushioned divan. Life in the Topkapi was obviously lived horizontally.

The newer Dolmabahce Palace was an attempt to sit up straight. The Sultan and his harem left the Topkapi and moved into the new palace on the Bosporus in 1855. Built in the most florid European manner, it was part of the modernizing and Westernizing instincts current among the Ottomans in the 19th century. But it was not without a degree of Oriental extravagance. The bill for the furniture, as well as for European frocks for his harem, equalled the annual expenditure on the entire Ottoman army in Thrace.

I trooped through reception rooms the size of football fields, across carpets of 100-square meters, beneath chandeliers that weighed over three tons, to the harem quarters which looked no more exciting than middle-class apartments in Paris. After the Topkapi it all seemed a bit tame. Where was the beautiful tilework, the wonderful courtyards, the elegant arcades, the gorgeous pavilions where Sultans drank wine and dallied with concubines while the empire went to hell? Selim the Sot would have been disappointed.

Where to Stay: The best hotel in Istanbul is the Four Seasons Sultan Ahmet (+90 212 402 3000), which is walking distance to the Tokapi; doubles from $575. A more affordable budget option is The Empress Zoe (212 518 2504; info@emzoe.com), also near the Topkapi, where double rooms are from about $92.

Food and drink: Istanbul has always been a fabulous place to eat, but its restaurant scene is booming at the moment. Try 5 Kat (212 293 3774) on the fifth floor at No 7 Soganci Sok in Beyoglu for great atmosphere and great views. There is a proper bar as well as a restaurant; dinner from $30. G by Karaf (212 327 0707; gbykaraf@superonline.com) at 44 Muallim Naci Caddesi in Ortakoy is the place for beautiful people and beautiful food; dinner from $45. The night club next door will make you wonder where you are. Zencefil (212 243 8234) at 3 Kurabiye Sokak near Taksim is a great place for lunch, from $15. Pandeli (212 522 5534) above the entrance to the Spice Market is a creaky institution, but full of atmosphere, from $15.

Palaces: The Topkapi (212 512 0480) is open daily, except Tuesdays, from 9am to 5pm; admission is $15. There is a further charge of $9 for the harem. The Dolmabahce Palace (212 236 9000) is open from 9am to 4pm every day except Mondays and Thursdays; admission $5.50.

Hamams: Cemberlitas (212 522 7974) is one of the best hamams for novice foreigners. Close to the Grand Bazaar, it is open from 6am to midnight daily; admission with massage is $17. Nearby the Cagaloglu (212 522 2424), 7am to 10pm daily, is architecturally stunning; $18.50 with massage.

Further reading: Istanbul, Time Out Guide ($19.95) is best for services as well as sights. Check out the English language versions of Istanbul’s Time Out monthly magazine for entertainment. At No 11 Divan Yolu Caddesi you will find the best English-language bookshop in the city, simply named Bookshop.

Stanley Stewart has written three award-winning travel books – Old Serpent Nile, Frontiers of Heaven, and In the Empire of Genghis Khan. He is also the recipient of numerous awards for his magazine and newspaper articles. He was born in Ireland, grew up in Canada, and now divides his time between Rome and Dorset.