Image copyright © The British Library Board

A book of illustrations painted in the 1840s captures the Indian capital, Delhi, in all its glory shortly before the 19th Century's biggest anti-colonial revolt - and the British bombardment, looting and sacking that followed. It was to be a poignant epitaph to two millennia of Indian painting, writes the historian William Dalrymple.

Bahadur Shah Zafar was the last Mughal emperor, and one of the most talented, tolerant and likeable of his remarkable dynasty. Born in 1775, when the British were still a coastal power clinging to the Indian shore, he lived long enough to see his dynasty reduced to humiliating insignificance, and the British transform themselves from simple traders into the most powerful military and economic force India had ever seen.

Zafar came late to the throne, succeeding his father only in 1838 when he was in his mid-60s, and when it was already too late to reverse the inexorable political decline of the Mughals. But despite this he succeeded in creating around him a court culture of unparalleled brilliance, and partly through his patronage there took place in Delhi a last great literary renaissance.

Find out more William Dalrymple presented A Short History of Indian Art as part of BBC Radio 3's The Essay Listen on BBC iPlayer Radio

While Zafar was himself a mystic, poet and calligrapher of great charm and accomplishment, his greatest achievement was perhaps to nourish the talents both of Urdu's supreme love poet, Ghalib, and his great rival Zauq. While the British progressively took over more and more of the emperor's power, removing his head from the coins, seizing complete control even of the city of Delhi itself, and finally laying plans to remove the Mughals altogether from the Red Fort, the court busied itself in obsessive pursuit of the most cleverly turned love lyric, the most moving ghazal, the most perfect Urdu couplet. As military and economic realities of British ambitions closed in, the court was lost in a last idyll of pleasure gardens, miniature painting and poetic symposia.

It is more than ironic, therefore, that the most complete and remarkable pictorial record that exists of the last days of Mughal Delhi, known as The Delhi Book, comes from the patronage not of Zafar, nor of the Mughal Court itself, but from Zafar's would-be nemesis, the notably unimaginative British resident (or ambassador), Sir Thomas Metcalfe.

Image copyright © The British Library Board Image caption A portrait of Bahadur Shah Zafar in the Delhi Book

Metcalfe's arrival in Delhi brought to a close a period which had seen a great deal of social, cultural and sexual interaction between the East India Company and the Mughal court. One of Metcalfe's predecessors, for example, was Sir David Ochterlony who every evening used to escort all 13 of his Indian wives around the Mughal capital, each on the back of her own elephant. At the beginning of the 19th Century such behaviour was far from unusual: at this period, after all, one in three British men in India was living with or married to Indian women. Ochterlony's assistants had included Edward Gardner and William Fraser who according to one shocked memsahib "both wear immense whiskers, and neither will eat beef or pork, being as much Hindoos as Christians, if not more; they are both of them clever and intelligent, but eccentric; and, having come to this country early, they have formed opinions and prejudices, that make them almost natives."

These White Mughals became important patrons of Mughal painting, transforming the art of the capital in the process. The best works produced under Company patronage are unparalleled in Indian art and show a sympathy with the Mughal world quite at odds with prevailing stereotypes of colonial philistinism and insensitivity. These works produced by Mughal painters for British patrons are sometimes classified as "Company Painting", but in the Mughal capital it is impossible to make any meaningful distinction between "Company" and "Mughal" work as the same families of artists were working in very similar styles for Indian, English and mixed-race Anglo-Indian patrons.

Thomas Metcalfe, however, was a very different man from these White Mughals whom he replaced.

Image copyright © The British Library Board

A cold and fastidious Englishman, he would have blanched at even the thought of a "native" mistress. Indeed so refined were his feelings, according to his daughter Emily Bayley, that he could not bear to see women eat cheese. Moreover he believed that if the fair sex insisted on eating oranges or mangoes, they should at least do so in the privacy of their own bathrooms.

He would never have dreamt of dressing as Ochterlony had, in full Mughal pagri and jama. Instead, he arranged that his London tailors, Pulford of St James's Street, should regularly send out to Delhi a chest of sober but fashionable English clothes. A trunk of the latest English books was likewise dispatched twice every year. His one concession to Indian taste was to smoke a silver hookah. This he did every day after breakfast, for exactly 30 minutes. If ever one of his servants failed to perform properly and efficiently his appointed duty, Metcalfe would call for a pair of white kid gloves. These he would pick up from their silver salver and pull on over his long white fingers. Then, "with solemn dignity", having lectured the servant on his failing, he "proceeded to pinch gently but firmly the ear of the culprit, and then let him go - a reprimand that was entirely efficacious".

Much of Metcalfe's professional life was dedicated to limiting the power of Bahadur Shah and preparing to abolish the Mughal dynasty. Yet his attitude to Delhi and its Mughal culture was much more ambiguous than this political stance might suggest and, almost against his better instincts, he slowly came to fall in love both with the city he presided over, and the high Mughal culture which animated it.

To act as a record of his love, between 1842 and 1844, Metcalfe commissioned The Delhie Book, a series of images of the monuments, ruins, palaces and shrines of the city from a brilliant Delhi artist named Mazhar Ali Khan. He later had the images bound into an album, and wrote an accompanying text which he sent to his daughter Emily to act as her guide to the city, as she headed from school in England to join her father in the Mughal capital.

Image copyright © The British Library Board

Mazhar Ali Khan was part of a family of artists, the patriarch of whom, Ghulam Ali Khan, had probably worked for William Fraser on a similar commission some 25 years earlier. The result, known as the Fraser Album, is now recognised as one of the supreme masterpieces of Indian art. All the artists of the family had clearly been trained in the old Mughal techniques of miniature painting, but working for Fraser and Metcalfe, using English watercolours on English paper, and taking English architectural elevations and botanical still lives as their models, an extraordinary fusion of English and Indian artistic impulses took place. This fusion that resulted in an extraordinary final phase to the history of Indian miniature painting.

The brilliance and simplicity of the colours, the meticulous, almost hypnotic attention to detail, the gem-like highlights, the way the picture seems to glow, all these point unmistakably towards Mazhar Ali Khan's Mughal training, as does his idiosyncratic approach to perspective. No English artist would have thought of using the astonishing palette of colours that still stands out in the library display like a small aesthetic firework display; the tentative washes of a memsahib's watercolour are a world away from this work.

Image copyright © The British Library Board

The usual Mughal attention to fine detail is fused with a scientific European rationalism to produce an architectural painting that both observes and feels the qualities of a building. Thus while the picture of the tomb of Ghazi ud-Din minutely reproduces the proportions and detail of the Mughal domes of the mosque behind it, the artist has also understood the ideal of lightness and delicacy which the architect was aiming at, and produced an image of the building as fine and as fragile as a lace ruff: the tomb, you feel, is so delicate and ethereal it could almost be blown away with a breath.

But for all the life and colour of the paintings, there is a sadness inherent in its images; for it records a city on the eve of catastrophe and destruction. On a May morning in 1857, only 13 years after the album's completion, 300 mutinous sepoys rode into Delhi, massacred every British man, woman and child they could find in the city, and declared Zafar emperor.

Image copyright Getty Images Image caption A scene from the batteries on the Delhi Ridge, during the Indian mutiny of 1857

No friend of the British, Zafar was powerless to resist being made the leader of an uprising he knew from the start was doomed, an officerless army of peasant soldiers set against the forces of the world's greatest contemporary military power. Within a month, Delhi was surrounded by the British and the scene was set for one of the most gruelling and pitiless conflicts in Indian history. Known in Britain as the Indian Mutiny, and in India as the First War of Independence, it was the largest anti-colonial revolt against any European empire anywhere in the world in the entire course of the 19th Century

The Siege of Delhi was the Raj's Stalingrad: a fight to the death between two powers, neither of whom could retreat. For the four hottest months of the Indian summer, the beautiful Mughal capital was bombarded by British artillery with thousands of helpless civilians caught up in the horrors. There were unimaginable casualties, with both Indians and British starving, the city left without water, and the combatants on both sides driven to the limits of extreme physical and mental endurance. Finally, on 14 September 1857, the British attacked and took the city, sacking and looting as they went. Anyone who survived the subsequent massacre was driven out into the countryside. Delhi was left an empty ruin.

Image copyright ALAMY Image caption An illustration depicting the arrest of Bahadur Shah Zafar

In the weeks that followed, the vengeful British oversaw the wholesale destruction of great areas of Delhi. The Red Fort was plundered and much of it - including the exquisite harem courts - was razed to the ground. Though the royal family had surrendered peacefully, all 10 of the emperor's surviving sons were shot in cold blood. The emperor himself was put on show trial in the ruins of his old palace, and sentenced to transportation. He left his beloved Delhi on a peasant's bullock cart. Separated from everyone and everything he loved, broken-hearted, the last of the Great Mughals died in exile in Rangoon in 1862, aged 87.

The last Mughal renaissance which Zafar had nourished was destroyed forever in the bloodletting of 1857. But miniature painting outlived for a while the destruction of the Mughal court, to die a slow death at the hands, not of sepoys or vengeful grenadiers, but of photographers.

Photography was introduced to the subcontinent in the early 1840s and by 1870 had totally altered the way the court painters went about their work: princely portraits soon began to be strongly influenced by photographs, while in some cases, black and white photographs used to be hand painted by miniature artists to make them more closely resemble miniatures.

In 1877, my great uncle, the pre-Raphaelite artist Val Prinsep arrived in Delhi to collect material for a picture the government wished to present to Queen Victoria as India's new empress. Soon after his arrival, Prinsep received a visit from the artists of Delhi, who he discovered now worked entirely "from photographs, and never by any chance from nature". The same bright colours and marvellous attention to detail were still on show—"their manual dexterity is most surprising" he wrote. But this was a last stand. By the end of the century many had given up and either become photographers themselves, or else retreated into producing crude reproductions of earlier work for the tourist trade. Miniature painting as a tradition was now dying, as Prinsep was one of the first to realise. "It is a pity," he wrote, "that such wonderful dexterity should be thrown away."

An unbroken indigenous Indian tradition which began with the murals of Ajanta 100 years before Christ, died a slow and lingering death over the second half of the 19th Century. The Delhi Book, the last major project of that tradition, and one ironically commissioned by an Englishman, sits today in the British Library like a last survivor, to record just how much was lost.

More from the Magazine

Image copyright Thinkstock

In the early summer of 1819, a British hunting party, lost in the arid mountains of the Western Ghats, made a remarkable chance discovery. Following a tiger into a remote and narrow river valley, the hunters stumbled on to what was soon recognised as one of the great wonders of India - the painted caves of Ajanta.

A Point of View: What we can learn from the caves of Ajanta (April 2014)

William Dalrymple presented A Short History of Indian Art as part of BBC Radio 3's The Essay - listen on BBC iPlayer Radio

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.