David Cameron has offered Pakistan £650 million in aid, improved trade in goods and services and enhanced security co-operation as he sought to patch up relations after a high-profile spat last year.
On his first visit to the south Asian state since becoming Prime Minister, Mr Cameron called for a "fresh start" to relations between Pakistan and the UK, nine months after he sparked fury in Islamabad by accusing it of turning a blind eye to the export of terror.
Mr Cameron went out of his way to praise the efforts of President Asif Ali Zardari's government to clamp down on militants near the Afghan border and said he "saluted the resilience" of the Pakistani people after 3,000 civilian deaths in the last year alone.
But he faced tough questioning from Pakistani journalists over his "obnoxious" comments last July, plans to limit student visas, Britain's failure to extradite former military ruler Pervez Musharraf and the reportedly shaky position of Muslim Cabinet minister Baroness Warsi.
Mr Cameron hailed the work done by Lady Warsi, who was accompanying him on the trip, but did not explicitly guarantee that she was safe in the expected Government reshuffle.
The announcement of £650 million over four years to get four million more Pakistani children into school will make the country the single largest recipient of UK aid.
But Mr Cameron acknowledged that the gift will spark disquiet at home at a time when schools are being cut in the UK and Pakistan has just ordered six new military submarines from China.
In a speech at the Islamabad Institute of Information Technology, Mr Cameron told students: "Back in the UK, we are taking some incredibly tough economic decisions.
"We are cutting some public spending and increasing some taxes. And, understandably, the British people want to know every penny we spend is going to the right places. I need to convince them that it is.
"But my job is made more difficult when people in Britain look at Pakistan, a country that receives millions of pounds of our aid money, and see weaknesses in terms of government capacity and waste."