Cities all rise and fall, wrote the French author Pierre Gilles in the 16th century. Except one. “Constantinople alone seems to claim a kind of immortality and will continue to be a city as long as humanity shall live either to inhabit or rebuild it.” There always has been something special about the glorious metropolis nestled on the banks of the Bosphorus, at the point where Europe and Asia meet.

Bettany Hughes’s ebullient book is an ode to three incarnations of the city: Byzantion of the ancient past; the Constantinople that was the capital of the Christian Byzantine empire; and the Constantinople of the Muslim Ottomans that today goes by the name of Istanbul. Hughes guides us round a city that is majestic, magical and mystical, leaving few stones unturned. It is a loving biography of a city that never stands still, never mind never sleeps.

Visitors would sink ‘utterly into corrupt luxury’, wrote one sour author over 2,000 years ago

Legend has it that the town of Byzantion was founded by King Byzas, who was blessed with strong touch of the divine: his father was the sea god Poseidon. His grandfather was none other than Zeus himself, whose cavorting with a priestess named Io got him into trouble with his wife. Io was turned into a cow that was so afflicted by a gadfly sent to torment her that she crossed the straits that became known as Ox-ford – or, rather, the Bosphorus.

Byzas chose a fine site for his city, one with natural harbours, a plentiful water supply, a rich hinterland for agriculture – and fishing waters that were famous in the ancient world. They were so plentiful, in fact, that Agamemnon offered them to Achilles when trying to spring him from his famous sulk during the Trojan war. The natural wealth made Byzantion’s inhabitants rich – and made others jealous. Visitors to the city would sink “utterly into corrupt luxury” wrote one sour author over two thousand years ago, setting the tone that many others would follow for centuries. Life was easy if you lived in the city; it seemed too easy if you didn’t.

Byzantion was so well located at the intersection of trade routes that it served as magnet and not only for those living locally. Eventually, the Roman emperor Constantine decided that Rome itself was too far away from the action and after being “led by the hand of God” to Byzantion, invested lavish funds transforming it with palaces, monuments, temples, but also churches, following his own adoption of Christianity. In due course, the city of Constantine – Constantinople – became the capital of the empire itself, its importance magnified after Goths, Vandals and more besides rampaged through Europe.

The eastern part of the empire not only survived but flourished, especially under rulers such as Justinian and his formidable wife, Theodora, who built monuments worthy of the Queen of Cities. These included the astonishing Hagia Sophia, a church of “indescribable beauty” in the words of one contemporary, hard to disagree with today. The city drew gasps of wonder from far and wide, as Hughes shows, roving admirably from Scandinavia to China, following visitors who etched their names in graffiti into its monuments or reported back that the palaces were decorated with lapis, had floors made of yellow gold and were fitted with elaborate hydraulic systems to keep the inhabitants cool.

Byzantine Constantinople’s sophistication and wealth were its undoing. It attracted merchants, but also attention – from Vikings, pilgrims and supposedly even from King Arthur, who was determined to become its master. Eventually, in 1204, it fell, ransacked by knights taking part in the Fourth Crusade who diverted from their holy obligations to ransack the city, capturing some of the most priceless relics in Christendom as they rampaged through the streets.

The western experience of running Constantinople ended in failure, because the magic ingredient in making a cosmopolitan centre of that size work was good administration, something rough knights neither understood nor had an aptitude for. By the 15th century, it was the Ottomans who set about trying to take it, finally doing so in 1453. It was the fulfilment of a destiny that promised that a city that was “like a diamond set between two sapphires and two emeralds” would fall into their hands.

Ottoman Constantinople was yet another chapter in the reinvention of a city and of its past. New styles were introduced, like the Topkapi, showcasing “a new decidedly eastern way of living”, alongside places of worship of the new dominant faith, Islam, such as the Eyüp Sultan mosque. In some cases, old was torn down to make way for the new, with columns from the Hippodrome being used for a hospital.

The city did not lose its mystique, nor the sense of the exotic for which it had always had a reputation. Dances that took place before weddings were “of the most unrestrained and immodest nature”, according to one prudish British visitor, though others were taken by the beautiful silk clothes and “swelling turbans” worn by the inhabitants.

By the start of the 20th century, views about Constantinople and its citizens had become not so much negative as toxic, especially those who had their eye on taking control of the city for themselves, as the British did straight after the first world war. The Turkish presence in the city was like “a plague”, said Lord Curzon, while Lloyd George wrote that since the Turks took it over, it had become “the hot bed of every sort of eastern vice” and “the source from which the poison of corruption and intrigue has spread far and wide”.

Bettany Hughes has written an important book that brings the past of this glorious city to life. It is filled with charming vignettes, like the case of one sultan’s wife asking Queen Elizabeth I for makeup, or the popularity of panoramic scenes of Constantinople in London at the start of the 19th century, and is snappily written: the empress Theodora had “her meal ticket revoked” before she married Justinian, we are told; after Greece became independent, “rather than sulking, the city chose to adapt”.

Chapters are kept short and entertaining, broadly in chronological order, but with the author sidestepping to look at such diverse topics as “sex and eunuchs”, “the white slave trade and white plague” and “statues in the sky”. Hughes has read widely and is impressively up to date with the latest archaeological discoveries, including that of a warrior tomb found only last year. There is plenty here to entertain those who know something about the city, and even more to enthral those who don’t.

It is a shame that Hughes ends the book in 1923 (although the period since is covered in brief in the final chapter), the point where the city’s name formally became Istanbul. This could have been the tale not of three but of four cities, for Istanbul changed greatly under Atatürk, just as it is changing rapidly under Erdoğan. But as the author so eloquently reminds us, the rulers of this majestic city have always had a swagger. And if Pierre Gilles is right, they will continue to do so long into the future.

• Peter Frankopan’s book, The Silk Roads: A New History of the World, is published by Bloomsbury. Istanbul: A Tale of Three Cities by Bettany Hughes is published by W&N (£25). To order a copy for £19.99 go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99