Two hundred and fifty years ago, the Punjabi hilltown of Guler was the Urbino or the San Gimignano of the Himalayan foothills. Behind its formidable walls, amid a region racked by intermittent warfare between a patchwork of rival principalities, its rulers were notably discerning patrons of the arts: poetry, dance and music all flourished in this remote valley. But, in particular, the town was famed for its painters.

Now as then the town occupies a spectacular site above a bend in the river Ravi. It is surrounded by wooded hills, the view on one side framed by the snow-dusted peaks of the Dhauladhar range and on the other by a large lake, kingfisher-blue in the morning, turning silver by late afternoon. Today, nothing but a small village, all leathery water buffaloes and herds of goats, squats behind the once magnificent walls. But although now half-returned to the jungle, with roots and vines spiralling over its bricks, much of the fabric of the 18th-century town still exists: the farmer’s milking yards and buffalo sheds reveal themselves on closer inspection to be crumbling courtyard houses, or havelis. The elegant colonnades and courtyards that were once home to Punjabi princes are now occupied by peasant women in Pahari headscarves churning buffalo milk and threshing grain. All around rise the spires of substantial temples buttressed by banyan trees with aerial roots intermeshed with purple flowers from the jacaranda. Overlooking everything are the battlements of Guler fort.

I had come to follow in the footsteps of the 18th-century painter Nainsukh. Many of his works are now in the world’s leading museums, but murals influenced by his innovations can still be found on temple walls all over the Himalayan foothills. I planned to see the landscapes, villages and palaces that he lived in, as well as the best of the frescoes that were painted in the tradition that he helped to change for ever: it was to be a sort of Himalayan equivalent of the Piero della Francesca trail through Tuscany, Umbria and Le Marche.

Nainsukh was the son of Pandit Seu, the leading painter in Guler at the turn of the 18th century and a brilliantly innovative miniature artist. The puritanical Mughal emperor Aurangzeb had begun disbanding the Mughal atelier in Delhi and, as a result, some of the finest painters in the capital were migrating elsewhere, looking for patronage in the regional courts that had sprung up to fill the void left by the shrinking empire. Many of the greatest Mughal painters seem to have come from Kashmir and the Punjab hills, and as work ran out in Delhi, they returned home to courts such as Guler in search of employment.

Pandit Seu and both his sons, Manaku and Nainsukh, painted in a style that showed familiarity with the latest work being painted in Mughal Delhi; but the subject matter that interested the rajahs of Guler was very different to the court scenes and dynastic histories beloved of the Mughals. For the rulers of Guler were devoted Vaishnavite Hindus and commissioned extensive cycles of illustrations to their favourite religious texts: vibrant images of the Ramayana with its exiles, struggles, losses, battles and redemption – then an even more elaborate cycle of meditations on the Gita Govinda, the love poem at the heart of the cult of Krishna, with its tales of the unquenchable love of the beautiful Radha for the irresistible cowherd-god, and their secret assignations and erotic trysts in the depths of the night-forest.

After a day exploring the melancholy ruins of the town where Nainsukh spent his childhood and apprenticeship, I sat on the banks of the rushing river at nearby Kaleshwar Ghat, watching the sun go down behind the crumbling Sati temples of the Guler rajahs. I spent the night at Judge’s Court, a fabulous Victorian lodge with wooden floors, good Punjabi food and a fine rose garden, then set out along the rim of the Himalayan foothills to Damtal, an ancient ashram-temple complex above Pathankot.

You enter under a cream-coloured gateway built during the reign of Ranjit Singh, as the Sikhs were extending their rule over the Punjab hills. Between some cenotaphs, a courtyard of ascetic’s cells and a large banyan tree, lies a small Ram temple. Its façade is covered with courtly scenes: hunters on elephant-back pursuing cheetahs, lovers setting out for picnics, durbar scenes where noblemen are being ushered into the presence of the King of Ayodha. There is a teeming energy here that taps into the larger-than-life power of the Ramayana’s mythology; but the real treasure lies hidden upstairs.

In what was once the mahant’s living chambers is a sequence that shows the climax of the epic, the attack on Lanka and the liberation of Sita; but in this version the victorious army that undertakes these heroic actions is Ranjit Singh’s 19th-century Sikh khalsa, while the armies of Ravan are depicted as demonic East India Company sepoys in redcoats.

From Damtal, I continued in Nainsukh’s footsteps to Jasrota. Just as Raphael moved from Urbino to Rome to make his name, so Nainsukh moved to find a more generous patron and, having found his niche, was in due course to prove himself probably the greatest of all the Indian artists of the 18th century, and certainly the greatest painter from the Punjab hills. It was in Jasrota that the artist spent his middle years in the court of his principal patron, Mian Zorawar Singh and his son, Rajah Balwant Singh, and here that he produced his greatest masterpieces.

These include “A Leisurely Ride”, my favourite of all his works, which is now in the Victoria and Albert Museum in London. It shows a courtly company riding out on a winter’s evening. In this painting you can almost hear the male singer Saddu with his lute, and admire the vulnerability and beauty of the lovely dancing girl Amal as she rides swathed in her winter shawl, turning back to catch the eye of Mian Mukund Dev, another of Nainsukh’s patrons. This is Indian courtly life at its most elegant and perfect: music, the faint bubble of water pipe, the chill of a winter sunset, a mist of yellow winter mustard, hunting dogs out on the hills looking for partridges and a blossoming love affair, with its consummation soon to come.

Nainsukh’s work brings together all the precision and technically-exquisite detail of the Mughal tradition, the bright colours of Rajasthani painting, the elegance and beauty of Pahari art. To all this he adds a refinement, a humanism and a precise observational eye. He breaks free from the formality of so much Indian court art to explore the human reality, stripping down courtly conventions to create miniatures full of living and breathing individuals. Even in his large crowd scenes, there are no “stock” characters – everyone, each page, each villager, each gardener, is shown in portrait form as a real person.

A view towards Chamba, from the road to Devi Kothi

Today, the palaces of the Jasrota rajahs lie on the edge of a cliff at the top of the jungle-clad hill, in the middle of a leopard sanctuary. Two magnificent palaces crown the summit of the hill. Sadly both are roofless and all that remains of any frescoes Nainsukh might have painted are some fragmentary pieces of decoration under arches and over window frames.

Jasrota was clearly a much richer and more lavish court than Guler: Nainsukh had upgraded considerably by coming here. But Balwant Singh lost the throne sometime in the 1750s, and Nainsukh was forced to wander the region, first following Balwant from village to village until his death, then after that wandering in search of other patrons. But despite such reverses, his children and grandchildren continued and developed the family traditions from other centres in the Punjab hills. The most remarkable cycle of wall-painting influenced by their work lies several hours’ drive north of Jasrota, in the Pir Panjal hills on the borders of Kashmir.

Partly because of its very remoteness, many of the villages up here in the Chamba valley have managed to preserve their ancient art works from periods of history when these valleys were not backwaters but a major cultural crossroads, mediating the art of Afghanistan and Kashmir with that of the eastern Himalayas. One of the side valleys leads to the ancient shrine of Brahmaur where 7th-century sculptures of heavenly apsaras still show the influence of the humanism of the Bactrian Greeks from beyond the Hindu Kush. Another village, Chhatradi, contains an amazing cycle of 17th-century Pahari wall paintings showing the life and loves of Krishna.

But my way lay first to the north, towards Devi Kothi. As the road crosses the tree line, the landscape becomes bleaker: you find yourself in an ambiguous landscape of mist and rolling cloudbanks, mosses and lichens.

The final unmetalled descent down to Devi Kothi brings you back into deodar forests, and it is through this tree-cover that you first sight the village below. The stone houses tumble down a steep mountainside, the high-pitched slate roofs alternating with roof terraces where the women were drying apricots and stacking kindling for the winter. Looking down from above, you can almost smell the warm peach-brandy aroma of the drying fruit through the resin scent of the deodars.

A fresco at the remote village of Devi Kothi

This remote village is home to one of the finest sets of 18th-century frescoes in north India, and certainly the greatest cycle of Pahari painting still in situ. The frescoes decorate a tiny Himalayan shrine to the Great Goddess, and are the work of two brothers who completed their decoration of the temple in 1754. Here in the middle of these remote hills, on the walls of a small wooden shrine, are paintings that would do honour to the most sophisticated urban centre: straddled on her tiger, the Goddess swoops mercilessly down on an army of horned devils, cutting heads from necks with a sweep of her divine blade. In one hand she holds a shield, in others tridents, bells, and an assortment of spears and javelins. They are astonishingly strong and confident compositions.

Nothing is known about Gurdev and Jhanda, the two men who painted these images. But these were local boys, and closely in touch with the other masters working in the hills, especially the family atelier of Nainsukh. Today, most of Nainsukh’s work resides in the great museums of London, New York and Delhi, but it is here on the mountaintop at Devi Kothi, surrounded by this most remote of masterpieces, that you feel most strongly the remarkable world he belonged to, with great works of art still intact, virtually unknown and almost completely unvisited in this most beautiful and distant of locations.

William Dalrymple's latest book ‘Return of a King: The Battle for Afghanistan’ will be published by Bloomsbury in February

Details

William Dalrymple travelled as a guest of Banyan Tours (www.banyantours.com) and Steppes Travel (www.steppestravel.co.uk). The closest airport is Kangra (also known as Dharamsala), which is 90 minutes’ flight from Delhi