Asif Ali Zardari put the "war on terror" at the top of his agenda and signalled a thaw in relations with Afghanistan by having its leader, Hamid Karzai, at his inauguration yesterday as president of Pakistan.

In a short but emotional ceremony in the presidential palace in Islamabad, Zardari took the oath of office with a portrait of his assassinated wife, Benazir Bhutto, on one side and a picture of her father, Zulfikar Ali Bhutto, Pakistan's first elected leader, on the other. Their three children - Bilawal, Bakhtawar and Asifa - had flown into the country for the event and sat in the front row.

Following Pervez Musharraf's resignation last month, Zardari's swearing-in ceremony formally ended nine years of military rule. It raised hopes among investors and foreign allies led by the United States that it would bring a degree of stability after months of political turmoil and militant violence.

The presence of Karzai, the only foreign leader at the ceremony, was highly symbolic. He has repeatedly accused Pakistan of aiding Taliban insurgents seeking to oust his Afghan government and providing them with sanctuary in the tribal border areas. Karzai unexpectedly joined Zardari for a press conference after the oath-taking ceremony, where both presidents pledged to fight the militants which they said threaten both countries.

"Pakistan and Afghanistan are like twins conjoined," said Karzai. "They are inseparable and that is why both are suffering from the same troubles, by the same evils."

Earlier this year, Karzai had been so troubled by the apparent safe haven afforded the Taliban in Pakistan's tribal area that he threatened to take military action on Pakistani soil. He also openly accused Pakistan's intelligence services of complicity in the bombing of the Indian embassy in Kabul in July. India and the US have also alleged that Pakistan is backing extremists.

Zardari promised to work against militants, saying he too was a victim of terrorism. "We stand with our neighbours. We shall stand with each other, we shall not stand in each other's way," he said. "We will look at the problems in the eyes and tell the world that we are bigger than the problems are."

In practice, however, Pakistan's policy towards Afghanistan and its own militants is decided by the military, not by the government. There are signs that Washington is happier now with Pakistan's military cooperation, though it is unclear whether the army has altered its view that the Karzai regime is too close to Pakistan's arch-enemy, India.

Zardari will find it tough to sell the "war on terror" to voters. He made it clear that his government had no intention of ending its ties with the US, which has poured billions of dollars into Pakistan in return for help in fighting Islamic militants. Many Pakistanis oppose their country's role in the "war on terror", and blame it for fanning religious extremism.

The other major issue facing Zardari is the economic slump and spiralling prices that have pushed basic food commodities out of the reach of millions of ordinary people. The president will also have to work to consolidate the still-fragile democratic rule in Pakistan and overcome allegations of corruption.