David Cameron has hailed the "unbreakable" friendship between Britain and Pakistan after talks with President Asif Ali Zardari.
Shaking hands with Mr Zardari at his country retreat Chequers, he said they had discussed how to "deepen and enhance" their strategic partnership.
And he offered more help with Pakistan's "devastating" floods.
The UK prime minister is trying to smooth relations after recent comments about Pakistan promoting terrorism.
He said discussions had focused on making sure "we deal with all the issues where we want to make progress, whether that is in trade, whether it's in education, and also in the absolutely vital area of combating terrorism".
He said he and President Zardari would plant a tree in the grounds of Chequers in honour of the president's late wife, Benazir, "and the great things that she did for her country".
Mr Cameron caused anger in Pakistan last week when, during a trip to India, he said elements in Pakistan should not be allowed to "promote the export of terror whether to India, whether to Afghanistan or to anywhere else in the world".
Asked what was said during the talks about Mr Cameron's comments in India, his aide said she could not comment.
Standing alongside Mr Cameron at his Buckinghamshire retreat, Mr Zardari said he was grateful to Mr Cameron for "understanding the grievances and the problems we face in Pakistan" and the UK's support in the flood-affected areas of the country.
The UK has already donated £5m through Unicef, on top of £5m donated to the Pakistan Emergency Response Fund.
Mr Zardari said: "This is a friendship that will never break, no matter what happens.
"Storms will come and storms will go, and Pakistan and Britain will stand together and face all the difficulties with dignity and we will make sure that the world is a better place for our coming generations."
Downing Street sources told BBC News that both sides were very pleased with how the meeting had gone.
No 10 believes a constructive move forward has been made on counter-terrorism, with the setting-up of regular national security talks between top officials from both countries.
There will also be an annual summit between the two governments and Mr Cameron has been invited to Pakistan and will go soon, No 10 added.
Home Secretary Theresa May will visit the country in the autumn.
Mr Zardari has faced criticism over his decision to visit the UK at a time when his country is battling to deal with the aftermath of deadly floods.
While he was at Chequers, the worst monsoon rains in 80 years continued to sweep from the north-west to south and central Pakistan.
Pakistani authorities have evacuated 500,000 people in 11 districts of Sindh and issued warnings to people in low-lying areas of the Indus river.
There have also been questions about Mr Zardari's son, Bilawal Bhutto Zardari, who was reported to be about to launch his own political career at an event in Birmingham on Saturday.
Bilawal firmly denied this in a statement, saying: "I will not even be attending the event and instead I will be opening a donation point at the Pakistani High Commission in London for victims of the terrible floods which have ravaged northern Pakistan."
He said he planned to continue his education "both academic and political" and was "looking into the possibility of studying law".
President Zardari, who had a private dinner with Mr Cameron on Thursday evening, has already held talks with three other ministers.
But no details have yet been released about those meetings - with Conservative Party chairman Baroness Warsi, Home Secretary Theresa May and Education Secretary Michael Gove.