British military support and education efforts in Afghanistan are helping to tackle terrorism at its source, Boris Johnson said on his first visit to the country.
The Foreign Secretary held talks with president Ashraf Ghani and chief executive Abdullah Abdullah in Kabul.
Military trainers are working with the Afghan security forces at the country's national army officer academy and Mr Johnson hailed their efforts in helping to stabilise the country and tackle extremism.
He visited the academy - nicknamed Sandhurst in the Sand - and also saw work done by the British Council at Kabul University to support education and cultural projects.
The Foreign Secretary said: "Afghanistan is an amazing country and I'm incredibly proud of the work that the UK is doing here to challenge extremism and terrorism, promote democracy and human rights and support the Afghan Government's reform plans.
"British military trainers are improving the ability of the Afghan military to stabilise the country and respond to extremism, and our development works means girls are defying extremists by going to school and university. Our work also means that terrorism is increasingly tackled at source.
"Hundreds of British men and women continue to work here for noble reasons, in often highly dangerous circumstances, and we continue to owe them a huge debt of gratitude for the vital contribution that they are making."
Mr Johnson also went to the British Cemetery in Kabul to pay tribute at a memorial to the 456 UK servicemen and women who lost have their lives in Afghanistan since 2001.