When gunmen attacked the Sri Lankan cricket team in broad daylight, they struck in the heart of the most cosmopolitan city in Pakistan. Now the residents of Lahore fear that the religious violence that blights other regions has taken root on their own doorstep. Their bleak mood is the latest sign of the times in a troubled country. Jason Burke, Isaam Ahmed and Saeed Shah in Lahore report

There are old pistols and bulls' heads on the walls, live country and western music, waiters dressed as cowboys. The Gun Smoke restaurant could be anywhere in the world - but this is the exclusive Gulberg district in Lahore.

The whisky bottles are filled with tea. In the Islamic republic of Pakistan, there are only "mocktails" to wash the burgers down. Hassan "Jimmy" Khan is singing Johnny Cash. A 22-year-old economics student with a hippy beard and floppy hair, he has always lived in Lahore: "I love it, I wouldn't live anywhere else."

Here, amid the drinkers and diners in jeans and shirts, last week's terrorist attack on the visiting Sri Lankan cricket team, even though it took place less than a mile away, is forgotten.

Asher Mian, a 31-year-old accountant had brought his wife and toddler daughter to Gun Smoke. "That's the beauty of Lahore. People carry on," he said.

The attack, in which six policemen and a driver died, has provoked scenes unprecedented in Pakistan. Even after bloodier previous attacks, no one lit candles on the scarred bomb sites. The mundane roundabout where the Lahore killings occurred has been converted into a makeshift shrine - both to the dead and to the end of the idea that somehow this city of 10 million would be spared the violence racking the rest of the Pakistan.

This weekend, hundreds of bunches of flowers lay piled up before a poster, issued by the police, that reads: "We are in pain: no more bloodshed."

Lahore has never been like the rest of Pakistan. It has always been known as the most cultural, tolerant, and cosmopolitan of the nation's major cities. Karachi, the vast port in the south, faces the Gulf, Peshawar is turned towards central Asia. But Lahore, with its Mughal architecture, teeming bazaars and canals, remains very much part of the subcontinent.

The city is home both to vast slums and the headquarters of the Pakistan's biggest political Islamist movement, and to lively cafés, galleries, cultural centres, fashion shows, interior designers' studios and even a thriving gay scene. Parties thrown by the young Lahori elite have a reputation for daring even among blasé Karachi socialites. Gastronomy is part of life, as is cinema. Lahore is home to the Pakistani film industry: Lollywood.

Kamiar Rokni, one of Pakistan's leading clothes designers, is a fixture in the city high-life. The 32-year-old told the Observer last week that Lahore is the "cultural hub" of Pakistan.

"Lahore has always been a city where individuality has been embraced. It's been a safe city for such a long time, people have always gone about their business and not felt afraid ... So the attack on the cricketers is unfathomable.'

Others spoke of the shame of such a breach of traditions of hospitality. "In Pakistan, you do everything for your guests. Your guests are first priority. Even if you go hungry, they must eat," Ghulam Ali, a student, said. "Now we won't see any more cricket teams for the next 10 to 15 years. Forget cricket teams: no foreigners will visit."

And that, all agree, would be an immense blow to the spirit of the city. Sonnu Rahman, an 82-year-old history teacher and life-long Lahore resident, said that over centuries "all the different creeds and religions ... the Hindus, the Sikhs, Muslims, Christians ... got absorbed in this wonderful soil of ours".

"Even now, left to themselves, the people of Lahore are tolerant," she said. "It's just that they are used by these blasted politicians."

It is not as if Lahore has never suffered before. There have been a series of attacks over recent years. More than 20 were killed when a police building was bombed a year ago. A series of explosions at the city's theatres, juice bars (targeted for being "dating spots") and threats to DVD markets to stop selling supposedly "pornographic" movies revealed a rising tide of local religious vigilantism. But this most recent attack has brought home to the city - and the country as a whole - how bad things have got.

"After Benazir Bhutto was assassinated [in December 2007] we thought it could not get any worse,' said Dr Farzana Shaikh, an analyst at London's Chatham House think tank. "But it has. We won't see a dramatic explosion or implosion. We will just see bits of the country drifting out of government control."

Though Pakistan has repeatedly shown a resilience that has astonished those who repeatedly predict its imminent failure as a state - few other nations could have absorbed an economic crash, the assassination of its best-known political leader, a secessionist insurgency and a wave of religious militant violence in the space of 18 months without disintegrating - the international community is now deeply concerned for the future.

Last week, an American diplomat said openly what government analysts around the world have long said privately: Pakistan, with its crashing economy, nuclear arms and raging Islamic militant insurgency, is of greater concern than Afghanistan. The logic is simple: you can lose Afghanistan and still keep Pakistan, but the reverse is not true.

When the violence stays far away in the North West Frontier Province - seven policemen died in a car bomb yesterday, a local mayor was killed on Friday - the impact is less. On the Afghan border, though some areas are being clawed back from their hands, vast areas are still under the de facto rule of the "Pakistani Taliban". Last month, the NWFP government agreed a truce with Islamic militants that will see a rigorous version of sharia law imposed in the Swat valley, just three hours drive from Islamabad, the capital.

But it is the major attacks on high-profile targets close to the centres of cultural or political power that strike home - such as that on the Marriott hotel in Islamabad last year or this week's spectacular daylight raid on the cricketers - that shock and stun.

Sehr, who recently left New York to return to Lahore, says the sense of danger is now more imminent than before. "Now that I've come back, everyone is talking about how they want to leave," she said. "My parents say things aren't that bad, that there's always been instability. They hark back to the war in 1971 or General Zia's era, and say things aren't so bad. Pakistan has survived for 61 years so it'll keep on surviving, they say. [But] I feel anxious, to be honest."

The international community is equally worried about the economy and internal political stability. The recent $7.6bn International Monetary Fund bail-out has provided some temporary relief, but grave structural problems remain unaddressed.

"The IMF agreement is first aid, but not a solution," said Dr Kaiser Bengali, a respected Pakistani economist. "The coming 12 months will be particularly bad. Our banks are barely integrated into the global system, so the crisis hasn't hit us yet. But half our exports go to the European Union or America, and we are looking at mass lay-offs. The textile industry is already devastated."

Pakistan's economic development over recent decades has been uneven, with the Punjab, with Lahore as its capital, far outstripping the rest of the country. The economic downturn will have massive political and social consequences.

"The central Punjab now has a developed industrial base and a strong middle class. A huge divide has emerged, which is reflected in current political battle lines," Bengali said.

Last week saw the first major skirmishes in what is likely to be a vicious, long and destabilising contest between opposition leader Nawaz Sharif, whose Pakistan Muslim League faction's power base is the industrial and commercial middle classes of the Punjab, and the ruling Pakistan People's Party and president Asif Ali Zardari, the husband of slain leader Benazir Bhutto, whose support is drawn from poorer and more rural provinces.

A truce that started before the relatively free and fair elections of 2008 has long broken down and senior Sharif loyalists now believe the time is right to capitalise on their leader's popularity, proved in repeated polls. The first shots in this new struggle came when the highly politicised supreme court barred Sharif and his brother from office, in effect imposing direct administrative rule on the Punjab. Sharif is to use scheduled massive demonstrations by lawyers this week to pressure the government as negotiations between the rivals get under way. Many expect street violence and huge disruption.

Lawyers have long been demanding that Zardari rescind the draconian orders firing senior judges issued by former president General Pervez Musharaf. "This so-called democratic government hasn't lived up to its promises. The government is afraid of what an independent supreme court might do," said Munir Malik, a senior lawyer and leader of the movement. "We will march on the capital to demand the rule of law and the constitution."

The international community is also disappointed by the apparent inefficiency of Zardari's government. The alternatives, however, are unappealing. Sharif's popularity is in part based on his social and religious conservatism, a far more authentic expression of the views and identity of most Pakistanis than the views and lifestyle of the much more Westernised, secular Zardari. Sharif is increasingly viewed as the man most likely to be able to bring a measure of stability to the country's chaotic politics. American and British diplomats have thus made explicit efforts to build links to the Sharif camp. "Pragmatism is the order of the day," said one UK diplomat.

Even the recent violence in Lahore has become politicised. As a small band of flag-waving, slogan chanting PML-N supporters drove round the memorial at the attack site on Friday, many locals waved in support. Hadayatullah, a juice-shop owner, blames Zardari and embattled Punjab governor Salman Taseer, running the province now that the Sharif brothers have been barred from power. There are charges that the chaos following the ouster of the local provincial government led to security lapses.

The hunt for the killers is still going on. Early clues point to outlawed militant groups such as Laskhar-e-Toiba (LeT) and Lashkar-e-Jhangvi, both of which have links to security services and have carried out such "raids" in the past. LeT members are prime suspects for November's spectacular assault in Mumbai. However a spokesman denied involvement in last week's attack. Yesterday investigators in Lahore said that the most likely thesis was "one of our home-grown groups with a possible al-Qaida link".

Though authorities say they have now identified the attackers, they have released scant details beyond sketches. All that is currently known is that militants melted into the huge and sprawling city after the attack. It may be some time before they are caught - if ever.

At midnight, the last remaining stragglers are saying good-bye to their friends outside Lahore's Al-Hamra Theatre complex, a local landmark, having enjoyed a local Punjabi latnguage commercial drama, A Nest of Sparrows

The theatre is known for plays ranging from high-brow Urdu classics such as Toba Tek Singh and Hotel Mohenjedaro to Punjabi stage dramas full of raucous humour and suggestive dance moves popular with the working class. Recently, female dancers were ordered to cover up and theatre timings were shifted to earlier in the evening in an effort to encourage more families to attend and to pre-empt criticism from religious extremists. The measures did not prevent bombs going off at two theatres last month.

Irfan, a parking attendant at the theatre, says the violence is bad for business. "We don't get paid our salaries on time any more; it's hard to pay the rent now," he says. His monthly wages come to Rs6000 (£55), a quarter of which goes toward renting a cramped apartment. Irfan says that, since Lahore's theatres changed their timings, the number of customers has declined to almost a third.

"Earlier, at 2am we'd have 200 bikes and cars parked here. Now, we have 40 people on a good night." Down on Gawal Mandi, known popularly as "Food Street", bright lights illuminate the hawkers' stalls and the cafés. It is a popular venue for rich and poor to indulge the locals' love affair with food.

"In Lahore, the families make their lunch plans while having breakfast, and their dinner plans while having lunch," said Nadeem Ashraf, a jovial vendor at one tikka-shop. But Ashraf, too, has noticed a downturn.

"The times are bad; people are afraid to come out," he says. "It's these terrorists. Things aren't the same any more. Lahoris used to to be more genial, always meeting each other, always celebrating festivals with a great fuss. Culturally, things are changing."

Rickshaw driver Shahid shrugged when asked who was to blame for the attacks. "Educated people know better who it could be," he said. "Maybe [security] agencies, maybe politicians, a lot of people blame [Indian intelligence]. But to the poor, it's all the same, We have to feed our families, electricity rates are up, bread prices are up. It's the poor who suffer."

The Terror Toll

December 2007

Opposition leader Benazir Bhutto is assassinated, two months after her return from exile. A gunman opened fire as she left a political rally in Rawalpindi; seconds later a bomb engulfed her car, killing more than 20 supporters. Her death triggered violent demonstrations across the country.

September 2008

More than 50 people are killed by bomb blast at the Islamabad Marriott, a favourite hotel for foreign nationals in the city centre. The hotel's facade was ripped open by the massive car bomb blast.

November 2008

Pakistani gunmen unleash a co-ordinated attack on hotels, railways, hospitals and cafes across Mumbai , taking hostages and blockading themselves into hotels. A 58-hour siege ensues, leaving 179 dead. Investigation finds links between the gunmen and Pakistani military.

March 2009

Six Pakistani policemen are killed and seven Sri Lankan cricketers and officials are injured in attack on team bus. Gunmen opened fire as the team travelled to a Test match against Pakistan in Lahore.