The Queen and the Duke of Edinburgh will join senior members of the Royal Family at St Paul's Cathedral in London on Friday to honour veterans of the Afghanistan campaign and the servicemen and women who lost their lives.
The Prince of Wales and the Duchess of Cornwall, the Duke of Cambridge, his heavily-pregnant wife and Prince Harry - who served two tours during the conflict - will also attend to mark the end of combat operations in the country, along with the Earl and Countess of Wessex and the Duke of Gloucester.
Veterans of the 13-year campaign and the families of some of those killed will also take part in the commemoration, with Prime Minister David Cameron, Deputy Prime Minister Nick Clegg and Defence Secretary Michael Fallon.
Almost 150,000 UK personnel served in the conflict, and 453 British men and women died in the fight against the Taliban insurgency.
Their sacrifice will be honoured during the service, and the Archbishop of Canterbury and the Bishop of London will make addresses of remembrance.
The Archbishop will also bless a cross made of shell casings that adorned a memorial wall in the main Allied base in Afghanistan, Camp Bastion, before it is later moved to the Royal British Legion's National Memorial Arboretum.
Representatives of other nations which took part in the Nato-led International Security Assistance Force will also attend.
After the service there will be a parade through the City of London to Guildhall.
Five detachments will be made up of serving personnel from the Army, the RAF, the Royal Navy and the Royal Marines, with a sixth of up to 400 veterans from the conflict, brought together by the Royal British Legion (RBL).
They will march past St Paul's accompanied by military bands and pipes and drums, with Charles taking the salute.
Aircraft from the campaign, including Chinook, Apache and Sea King helicopters, as well as Hercules transport planes and Tornado attack jets, will roar over the parade in their own salute.
Members of the royal family will later meet those who took part in the parade or served in Afghanistan during a series of receptions.
On the same day, similar commemorations will be held at military bases, cathedrals and churches across the country, as well as for personnel serving in Germany.
A spokesman for the RBL said: "The end of combat operations in Afghanistan provides us the opportunity to reflect on the 453 Service personnel who lost their lives in that conflict and the many thousands more who served their country under trying conditions.
"The Legion salutes them and stands ready to preserve their memory and their welfare."
Following the announcement of the service last month, Mr Fallon said he hoped people throughout the UK would join together in "remembering those we have lost and recognising the extraordinary courage and dedication of all those who served".
He said: "They leave a proud legacy - terrorists have been prevented from using Afghanistan as a safe haven for attacks on our streets and it is a safer and more prosperous country."
The final chapter in the 13-year conflict came in October last year when the last British troops were airlifted from the sprawling Camp Bastion base in Helmand Province, leaving just a few hundred personnel in advisory, logistical and support roles to help the Afghan army.