In line with the NATO mission, the UK is drawing down from Afghanistan, with the US also removing troops from the country.
The Puma aircraft were flown from Kabul to RAF Brize Norton on an Antonov AN-225 and have now returned to RAF Benson.
Air Vice Marshal Nigel Colman, Commander of Joint Helicopter Command, said the Puma detachment has done a "superb job".
"Their contribution over such a sustained period has been second to none and they can be incredibly proud of the significant part they played," he said.
During the deployment, the Pumas flew 12,800 hours, the equivalent of more than 533 days in the air, transported 126,000 passengers and moved 660,000kgs of freight.
During Operation TORAL, the codename given to the UK element of Resolute Support Mission, the Pumas were based at Kabul International Airport.
From there, they could provide vital airborne transit to both UK and NATO forces – including transporting personnel and equipment around the different urban, mountainous and desert terrains in the Kabul area.
The Puma detachment was also able to support the deployment of the NATO Security Quick Reaction Force as needed.
Group Captain Nick Paton, the Puma Force Commander, said personnel "should look back on all that they have achieved with pride".
"This is a significant time for the Puma Force as a long-running and rewarding operation comes to a close," he said.
"The commitment and professionalism of the whole team has been exceptional, whether they've been deployed or provided support from the UK."
The detachment has been serving as part of the NATO-led non-combat mission to train, advise and assist the Afghan National Defence and Security Forces – also known as Resolute Support Mission.
About 750 UK troops have been deployed to Afghanistan as part of Operation Toral – Britain's contribution to the NATO mission.
Cover image: RAF Puma detachment returning from Afghanistan (Picture: MOD).