US presidential hopeful John McCain has said nations with "common values" must work together on issues such as climate change after talks with Gordon Brown.
Standing in Downing Street Senator McCain "applauded" the PM's lead on the issue, saying he was hopeful of a global deal including China and India.
He also said the situation in Iraq had improved, but added: "Al-Qaeda is on the run - but not defeated."
Sen McCain also expressed "gratitude" for the British "sacrifices" in Iraq.
His brief trip to London is part of a wider tour that has included visits to Iraq, Jordan and Israel.
He arrived at 10 Downing Street at 0843 GMT, departing just over 45 minutes later. He has also held talks with Conservative leader David Cameron.
Sen McCain is a Republican who looks set to become the party's presidential candidate this autumn.
He says his trip - which after London involves a stopover in Paris to meet French President Nicolas Sarkozy - is a fact-finding tour with fellow senators.
Talking to reporters in the street outside 10 Downing Street in central London, he said the talks had covered a "variety of issues".
He said: "We expressed our great appreciation for the long-standing and unique relationship that exists between our two countries, our common values and our common efforts that are made by both countries on national security and others."
"We discussed at length the issue of climate change, and my commitment to address the issue of climate change comprehensively and globally," Sen McCain said.
Iraq troop surge
"I appreciate the prime minister's leadership and plans for action.
"I am confident that we can reach a global agreement that would include China and India. I believe that it's a compelling issue for the world's environment and I am committed to it."
Sen McCain is the most senior Republican of the Senate Committee on Armed Services and a vocal supporter of the American troop surge in Iraq.
While he has criticised some aspects of the Bush administration's handling of the war, he argues that pulling out precipitously would hand a victory to terrorists and far too much influence to Iran.
"The problem with Iraq, in my view, is because it was mishandled after the initial success," he said.
"That caused great sacrifice, frustration and sorrow."
He went on: "It's well known that I have supported the surge and it is very clear at least to most objective observers that the surge has succeeded whereas others predicted it would fail."
He said he "fully appreciates" that sometimes people were "frustrated by our lack of progress in some areas".
But the situation had "improved dramatically in the last year", he stressed.
People were "living their normal lives" and al-Qaeda was "on the run", Sen McCain added.
"We thank the prime minister and the British people for the enormous service and sacrifice of the men and women of the military, both in Iraq and Afghanistan."
He refused to be drawn on his views on the British troops' move out of Basra in December, however.
In interviews ahead of his visit to London, Sen McCain had expressed concern about the UK's withdrawal of troops from southern Iraq.
Sen McCain told the Daily Telegraph the decision to confine British forces mostly to Basra airport had allowed armed factions to carve out territory in the city and the surrounding area.
"There are different factions that have taken over certain areas. Everybody knows that, it's not a secret and General Petraeus [head of US forces in Iraq] is concerned too," he told the paper.
David Cameron, leader of the opposition, said his meeting with Sen McCain was "fascinating and very productive" and covered subjects including Iran, Iraq, the global economy and climate change.
"Our conversation centred on Afghanistan where the senator praised the incredible work being carried out by British troops. We also discussed the need for greater co-ordination among the military and various authorities there.
"The Senator and I also spent time discussing our shared interests and how we can broaden the appeal of moderate Conservatism."