LONDON — Queen Elizabeth II joined veterans in a solemn service Friday as Britain commemorated the end of its combat operations in Afghanistan.

Prince William, his pregnant wife Kate, and Prince Harry — who served two tours during the conflict — also attended the ceremony at London's St. Paul's Cathedral to remember the war dead.

Britain was part of a U.S.-led coalition that fought the Taliban in Afghanistan following the September 11, 2001 attacks. Almost 150,000 Britons served in the conflict, and 453 died.

"Today is a moment for us to say thank you: Thank you to all who served, whatever your role," Justin Welby, the Archbishop of Canterbury said during the service.

Britain formally ended its 13-year campaign in Afghanistan in October, when the last British combat troops were airlifted from Camp Bastion in Helmand province, Britain's main base in the country. A few hundred soldiers remain in advisory roles to help the Afghan army.

Afghan President Ashraf Ghani told the BBC that the Britons who gave their lives in his country had "paid the ultimate sacrifice to enable us to live in freedom, in hope for peace, prosperity and dignity."

The international coalition's mission ended in December, leaving Afghan security forces to fight the Taliban alone. Last year was the deadliest since the insurgency began, and many expect the Afghan government to be tested this year once the fighting season begins in spring.

Friday's service was followed by a military parade through central London, with fighter jets and helicopters saluting from the air.

Former Prime Minister Tony Blair said earlier in an interview that sending troops to Afghanistan was "right and justified," although he had not foreseen how long the struggle would last when the conflict began.

"I think we have not yet understood the depth of this problem, the scale of it, and the need for a comprehensive strategy to deal with it," he told Forces TV.