Tony Blair and General Pervez Musharraf have said action is needed to tackle the causes of international terror - specifically the Middle East.
Pakistan's leader was in Britain for talks with Mr Blair
The UK and Pakistan leaders spoke after Gen Musharraf told the BBC the war on terror had made the world less safe.
At a news conference in London, Mr Blair said most "sensible people" saw the need for military action but it would be foolish to ignore root causes.
Gen Musharraf said al-Qaeda was "on the run" in Pakistan.
In an earlier interview for the BBC's Newsnight programme, it was suggested to the general the world was less safe - in part because of the campaign.
"Absolutely," he said, adding that the social grievances that helped recruit terrorists were not being addressed.
Standing next to Mr Blair he added that it was crucial to tackle the "core of what creates terrorists, what creates an extremist, militant environment which then leads on to terrorism".
"That is the resolution of political disputes."
Mr Blair said the two leaders had talked about Afghanistan, the wider war on terror, the situation in the Middle East and the ongoing dispute over Kashmir.
"We agreed that in Afghanistan there is some cause for optimism about the progress that has been made there," said Mr Blair.
"In respect of Iraq, we agreed that whatever the issues of the past, the important thing now is to see the strategy through and ensure that Iraq is
capable of becoming a stable and democratic state."
On the Middle East Mr Blair said: "Now is the moment to grasp the opportunity... there is the possibility of change opening up. I think the next period of time is absolutely crucial. If we don't seize this opportunity now it may not come for us again."
Mr Musharraf said more effort needed to go into fighting illiteracy and poverty as well as resolving the Israeli-Palestinian conflict.
In his interview with Newsnight, to be broadcast later on Monday, Mr Musharraf said there was a failure to tackle the core problems behind militancy.
"We are fighting it in its immediate context, but we are not fighting it in its strategic, long-term context."
He said a war on terror needed to combat the political disputes and social inequalities that gave rise to extremism.
"What gives rise to a young man or woman to give up her or his life? It is the political disputes and we need to resolve them and also illiteracy and poverty.
"These combined are breeding grounds of extremism and terrorism."
The president, who is on his first official visit to London, will visit the Pakistani community in Manchester after the talks.
Mr Musharraf arrived in Britain on Sunday night after flying from the United States, where he met President George W Bush.
The interview with Mr Musharraf was screened on Monday, 6 December, 2004.
Newsnight is broadcast on BBC Two at 2230 BST every weeknight in the UK.