Here in the city of Kim, Pakistan's magnificent history is being left to rot

Poor Lahore. Yesterday this jewelled city of the Raj was hit by a suicide bomber aimed at lawyers protesting at President Pervez Musharraf's imprisonment of his top judiciary. As body parts scattered the tree-lined Mall, Kipling's "city of dreadful night" became the city of dreadful day. Nor could the outrage have happened in a more symbolic spot. Just up the road from the bombed Victorian high court stands "Kim's gun", the great 18th-century Zam-Zammah cannon, pointing towards the scene.

While the historic cities of Pakistan's great rival, India, soar up the league table of celebrity, nothing better displays Pakistan's current misery than the state of Lahore, joint capital of many an Indian empire and of British Punjab. Splendid Victorian palaces still line the boulevards of the Mall: the high court, the governor's house, the general post office, the government college and Lahore's museum, Kim's "Wonder House". Even the art college built by Kipling's father, John Lockwood Kipling, survives, with students squatting under giant fans in its corbelled hall.

The style of these and other buildings is the "Anglo-Saracenic" (or Mughal-Gothic) with which the engineer/architects of the Raj paid their respects to a local culture over which they intended to rule for ever. Bursting with imperial confidence, the buildings are the glory of Punjab and the most remarkable group of 19th-century public buildings anywhere, complementing Lutyens's Edwardian Rajpath at the eastern end of the Grand Trunk Road in what today is India.

A mile away across this now sprawling 8 million-strong metropolis heaves and sweats Lahore's walled city, old and unchanged. Here, on a wet January night, one can easily imagine the fleet young Kim darting through the mud and huddles of humanity, over the rooftops on some mystery "woman's errand". At its heart lies Lahore fort, its gates, gardens, mosques and decorative finishes the finest Mughal monument after the Taj Mahal. Crowded outside its walls are scruffy courtyard houses (havelis), markets, food stalls, brothels and alleys of unimaginable dirt and decrepitude. Buried within are shrines, mosques and derelict palaces. Only a few structures have been restored by enthusiasts, such as the exotic Cuckoo's Den restaurant by the fort.

In no other world city have I seen so much magnificence so neglected. Pakistan's ancient sites, those of the Indus civilisation and Taxila and Moenjodaro, are well guarded. Limited preservation is being done on Lahore fort and Shah Jahan's exquisite Shalimar Garden in the suburbs. But saving Lahore itself has become a desperate struggle conducted by a few lone warriors, such as the Karachi architect Yasmin Lari, and Lahore's Kamil Mumtaz.

Yesterday's blast at the high court followed persistent attempts by the government to demolish the building, despite its handsome moulded brick walls and terracotta, marble and teak inside. The authorities also tried to demolish old Tollington market on the Mall. Looking like an East Anglian railway station, it was saved by public outcry and is now a thriving art centre.

Such carelessness is not for want of help. The World Bank offered $10m to restore the old city, which the authorities used to pay for drains. A so-called Sustainable Development Walled City project has hired offices and bureaucrats, but seems to have lost the will to conserve anything. Nobody is trying to stop a hotel company from buying up a street of havelis and demolishing them - houses that in Marrakech would be worth millions and might one day be so in Lahore. There is no protection for these structures, and if there were a well-placed bribe would negate it.

Even a modest project initiated by Lari to restore the royal route through the walled city from the Delhi Gate to the fort has ground to a halt, from a mix of corruption and inertia. The gate itself was demolished by the British in the 19th century but rebuilt, probably at Curzon's instigation, in the 20th. Through the murk of the royal route can be seen Mughal arches, lattice-work panels and classical porticos. All Pakistan's history is here, but disintegrating beneath encroaching shanties, cobwebs of wires and piles of rubbish. Meanwhile the dictatorship is spending $1bn on a new army headquarters in Islamabad.

Islamabad, five hours north of Lahore, offers a glaring contrast. This is Pakistan's own Chandigarh, Canberra or Brasilia, a new city built from scratch in the 1960s and with all the mind-numbing tedium that only 20th-century planning could inflict on humanity. Everything there before - natural or manmade - was simply bulldozed. A grid was imposed on the wide Potohar plateau. Each square was given a letter and number and allocated to commercial, retail or residential use, Soviet-style.

Embarrassed at the resulting soullessness, the city authorities are now seeking to recapture some of the character they destroyed, as are the planners of Britain's not dissimilar Milton Keynes. Anything surviving from the past, a village, a historic landmark, even a tree, is seized on to lend character to a settlement that lacks any sense of place.

The result has been the virtual demolition and rebuilding of a 16th-century village, Saidpur, on a hillside overlooking the city. A Hindu shrine has been stripped bare and made into a museum. "Illegal residents" have been cleared and their belongings dumped on the road, to make way for an ersatz tourism village of restaurants and boutiques: anything to suggest that Islamabad has a history. Elsewhere on the city outskirts, an old British station has been restored as a museum. At the pleading of a local artist, Fauzia Minallah, surviving banyans have been left standing, in one case in the middle of a motorway. These magnificent trees, she points out, constitute the nearest Islamabad has to "a national heritage".

Pakistan used to pride itself on its cities being cleaner and more modern than India's. This is no longer so. While Islamabad seeks to create a past for itself, Lahore's past is collapsing around it. Hovering over its ancient walls is a sense of utter neglect, so much so that some 400 buildings have been scheduled for demolition as dangerous.

The reason is rule by distant dictator. Some dictators take pride in their past, eager to make their mark on the nation's narrative. This was true of the Shah of Persia and even of Saddam Hussein. It is sad that present-day Pakistan, once a prized province of India's Mauryan, Mughal and British empires, should not only have cut itself off from that narrative but find itself at the mercy of an insecure and philistine soldier, for 10 years the puppet of London and Washington.

Though eager to be admired abroad, Musharraf has allowed one of the great cities of Asia to decline into squalor. For centuries the Grand Trunk Road from Delhi through Punjab carried the history of the subcontinent streaming beneath the walls of Lahore. But while India is at least fighting to rescue what remains of its past, Lahore is left to languish.

From the Indus to the Himalayas, Pakistan should be the object of every traveller's desire. Today it is awash with pessimists ready to declare its 60-year-old creation doomed and its further Balkanisation, begun with Bangladesh in 1972, inevitable. I am not sure, but any country that neglects its past loses touch with its present and endangers its future. In Pakistan the bulldozer is doing as much to hasten that danger as any suicide bomber.

Simon Jenkins