Britain's Tony Blair arrived in Pakistan on Saturday for talks with Pervez Musharraf on how to beat a resurgent Taliban, pool counter-terrorist intelligence and quell terrorism in Pakistan's religious schools.
Blair's spokesman said Britain and Pakistan would set up a joint working group between their interior ministries to promote closer links between their intelligence services.
Britain will also double its development aid, spending more on education in Pakistan's moderate Muslim schools to counter Islamic extremism, he said.
The British prime minister's visit comes as about 5,000 British troops are in Afghanistan, part of a 31,000-strong NATO-led force battling a revitalised Taliban, who are benefiting from sanctuaries in Pakistan.
A British government source told Reuters on Friday, "We want to move forward with Musharraf and the Pakistan government on Afghanistan, to convey the message about the need to get a grip on the Taliban - not just because they are killing British soldiers and local Afghans, but because that kind of extremist capacity is dangerous for Pakistan too."
Blair's visit to Pakistan follows a warning from the head of Britain's domestic spy agency that Muslim militants are plotting at least 30 major attacks in Britain.
One senior Foreign Office official said there was evidence Al-Qaeda was seeking the know-how to use a nuclear device.
British government sources say they are concerned about the flow of people and ideas between Britain and Pakistan, where some madrasas, or religious schools, double as terrorist training camps.
Nearly three quarters of a million British Muslims have roots in Pakistan.
"President Musharraf talks about 'enlightened moderation', we are supporting (that policy)," Blair's spokesman said.
Britain will donate £480 million over the next three years to Pakistan, partly to support the development of "moderate Muslim education" to counter radicalisation, the spokesman said.
It will also provide technical help and training in areas like forensic investigation and tracking terrorist financing.
Musharraf has denied allegations that members of his Inter-Services Intelligence (ISI) agency are covertly supporting the Taliban and doing little to prevent militant infiltration into Afghanistan.
"We are satisfied that we are getting the level of cooperation that we need. Of course, we have to keep developing that relationship," Blair's spokesman said.
The British government source said, "Musharraf and senior ISI figures are saying all the right things but, as with a lot of things in Pakistan, the further down the line you look, the less clear the situation becomes."
"There's a real question about delivery on the ground."
A total of 41 British troops have been killed in Afghanistan since 2001, 36 of them this year, amid criticism the force is under strength and has too few armoured vehicles and helicopters.
This has laid Blair open to criticism of his strategy in Afghanistan as well as Iraq, where his unflagging support for the US-led war has seriously hurt his popularity at home.
In an interview with Al Jazeera television on Friday, Blair responded to the suggestion that Western intervention in Iraq had been a disaster by saying: "It has."
Blair's spokesman said on Saturday that remark was "a straightforward slip of the tongue".
"He doesn't think Iraq has been a disaster," the spokesman added.