Boris Johnson has paid tribute to the “heroic efforts” of British troops and officials involved in evacuation efforts in Kabul – as the government unveiled plans to help Afghans settle in the UK.

The prime minister has written to the armed forces community to thank them for their role in Operation Pitting, which has seen thousands of people flown out of Afghanistan‘s capital following the Taliban’s takeover.

Afghans who have been brought to the UK will now be the focus of Operation Warm Welcome, which promises to provide support with health, education, employment, and accommodation to help them “fully integrate into society”.

Afghanistan latest news – follow live updates

Mr Johnson told those involved in the evacuations that they “should feel immense pride” for what they have done, including previous efforts as part of Britain’s 20-year Afghan campaign.

“Your efforts in difficult and hostile circumstances have seen the evacuation of thousands of British nationals alongside Afghans who worked with us, and who will now start new lives in the UK,” he said.

“I know that the events of recent weeks will have been hard for the armed forces community to watch unfold.

More on Afghanistan

“Over the last two decades, many thousands of you dedicated years of your lives to service in Afghanistan, often in the most arduous conditions. In particular, I realise that this will be an especially difficult time for the friends and loved ones of the 457 service personnel who laid down their lives.

“So I want to take this opportunity to offer my profound thanks for everything you did and to say without hesitation that you should take the greatest pride in your achievements.”

The government has come under heavy criticism from Afghan veterans on its own backbenches since the Taliban completed its takeover of Kabul earlier this month.

Some have questioned whether the collapse of the Afghan government rendered the efforts worthless, with question marks over whether human rights gains since 2001 – notably for women and girls – will now be reversed.

But a defiant PM said: “Our purpose in Afghanistan was simple – to protect the United Kingdom from harm – and you succeeded in that central mission.

“In the last 20 years, not a single terrorist attack has been launched from Afghan soil against the UK or any other Western country.”

Please use Chrome browser for a more accessible video player

PM’s ‘great sense of regret’ for those left behind

The prime minister said millions of Afghan girls had received an education thanks to the efforts of Western troops, and that no such gains “could swiftly be undone”.

“Whether you are still serving or a veteran, a loved-one, a relation or a friend, you all played your part and you should feel immense pride,” he added.

Analysis by Rob Powell, political correspondent

Boris Johnson is putting on something of a brave face when he speaks about the record of the UK in Afghanistan.

There can be no doubting the heroic efforts of troops working in the country over the last two weeks and two decades.

But serious questions of competence and strategy hang over the UK government.

Potentially the most pressing of these relate to the hundreds of people who were eligible for evacuation but – as the last UK troops pull out – still remain in Afghanistan.

Was enough done by the government to get them processed and into the airport? What chance do they now have of leaving the country as the Taliban takes full control and the UK’s diplomatic presence moves out?

Then there are the broader questions of strategy.

Boris Johnson points to what he sees as victories from the 20-year campaign: a degrading of the terror threat to the UK, education for women and infrastructure improvements.

But can the UK now genuinely “preserve the gains of the last 20 years and give the Afghan people the future they deserve”, as the prime minister has claimed this evening?

Many in his own party think not.

Conservative MP and Afghanistan veteran Tom Tugendhat today called the UK withdrawal a “national tragedy” and “shameful moment”.

It’s not hard to see why many believe any victories from Afghanistan are ultimately swamped by the defeats.

Troops who require support will be able to call upon the NHS Op Courage service, along with existing aid within their respective service.

Help for the Afghans arriving in the UK will be provided through plans dubbed Operation Warm Welcome.

It will be overseen by a new dedicated minister for Afghan resettlement: Victoria Atkins.

The plans include the creation of a central portal where people, organisations and businesses can register offers of support through volunteering, jobs, skills training, donations.

Free English language courses will also be provided in recognition that many of the dependents of former staff and Afghan translators may need this.

Please use Chrome browser for a more accessible video player

Patel meets arriving Afghan families at Heathrow

The PM said: “For those who have left their homes with no more than a small bag of belongings, and in fear for their lives, coming to the UK will no doubt have been a daunting experience, but also one of hope for the future.”

He added: “We will never forget the brave sacrifice made by Afghans who chose to work with us, at great risk to themselves. We owe them, and their families, a huge debt.”

Home Secretary Priti Patel added: “This week we have all seen the relief on the faces of those who have made it from Afghanistan to safety here in the UK.

“Our message to those who have already arrived, welcome – we are glad you are here and you will be treasured members of our communities.”

Full details of Operation Warm Welcome will be set out next week and build on existing commitments, which include £5m for local councils for housing support and the offer of a COVID vaccine for all arrivals.