David Cameron has taken a calculated and expensive diplomatic gamble by agreeing to put his faith in the Pakistani security services to help Britain leave Afghanistan, in the hope of preventing the export of terrorism to Britain. Nearly half of the terrorist plots against Britain come from Pakistans lawless north-west frontiers. On a visit to Islamabad, Cameron promised 950m in aid to fund 4m school places and 8,000 teachers, arguing that education is the best antidote to terror. Pakistan is now the largest beneficiary of UK aid. Cameron said he could justify the move domestically only if the Pakistani elite paid more taxes. He said bluntly, in a speech, that Pakistan suffered from 'weaknesses in terms of government capacity and waste. But he revealed a new willingness to work with Pakistani intelligence agencies to secure a political settlement in Afghanistan before Britain leaves in 2015. A year ago, Cameron put UK-Pakistan relations in deep-freeze by criticising the Pakistanis for facing both ways in the fight against terror. On Tuesday he talked of a fresh start and a new era of co-operation. British officials say they are now convinced that the growing internal terrorist threat inside the country has caused the intelligence service, the ISI, to take a tougher role in combating the Taliban and Al-Qaeda inside Pakistan. British officials said Pakistani prime minister Yousuf Raza Gilani and President Asif Ali Zardari recognised they were involved in 'an existential battle with terrorists. During his one-day visit, Cameron offered the president unprecedented intelligence cooperation and agreed to set up a joint 'centre of excellence in Pakistan to exchange knowledge on improvised explosive devices. He also sought to reassure his hosts that he does not see India as Britains preferred partner in the region. He set a goal of Anglo-Pakistani trade rising from 1.9b to 2.5b by 2015. In a sign of the importance of the trip to UK national security, Cameron was accompanied by Sir Peter Ricketts, the national security adviser, Sir David Richards, the chief of the defence staff, and Sir John Sawers, head of MI6. The three were in Islamabad only a month ago to prepare the ground for what is being billed as an 'enhanced security dialogue. The aim was to build a less transactional relationship, officials said, and to work on the basis of broader, long-term trust. At a joint news conference, Gilani said: I want to assure you that Pakistan has the resolve and the commitment to fight against extremism and terrorism. Weve paid a heavy price for that. He pointed out that 30,000 civilians had been killed and a similar number disabled. He said: The political leadership has been targeted. The bombs have gone off in girls schools, hospitals, the malls, the police stations and even in the intelligence service headquarters. Cameron praised his hosts: What you see in Pakistan is a huge fight by the government taking place against terrorism. He defended the size of the projected aid package, saying he would struggle to find an example of a country whose progress and success were more in Britains national interest than were those of Pakistan. But, unusually, he challenged Pakistan by pointing out that it currently spends only 1.5 per cent of national income on education, and has one of the lowest tax revenues, relative to GDP, of any country in the world. You are not raising the resources necessary to pay for things that a modern state and people require, he said. Too few people pay tax. Too many of your richest people are getting away without paying much tax at all. And thats not fair. British officials indicated that they had asked the Pakistan military as diplomatically as possible when it planned to enter North Waziristan, the tribal heartland and sanctuary from which many terrorist groups operate. British intelligence and the CIA consider the region to be the place where suicide bombings and cross-border attacks originate. Cameron made a partial reference in his speech, saying: Neither the Pakistan army nor Nato forces must ever tolerate sanctuaries for people plotting violence. The Pakistani army has suffered big losses as a result of clearing out other federally administered tribal areas, and seems to be holding back from tackling North Waziristan, partly due to a peace deal having been struck. Pakistani troops moved into South Waziristan in 2009. Pakistan says it lacks military capacity to lead an assault on a mountainous area that could lead to a mass exodus of refugees. In the absence of troops on the ground, Britain supports what it sees as the highly effective use of US unmanned drones to bomb terrorist targets in the area, a practice that Pakistani politicians regularly denounce as being counter-productive and in breach of their sovereignty, and leading to the slaughter of innocent tribal elders. Only last week, Pakistan pulled out of tripartite talks on Afghanistan in anger at the US attacks. Since 2007, about 164 drone strikes have been carried out, killing almost 1,000 militants. Guardian