The Duke of Cambridge has been booed as he arrived at a service marking 50 years of the UK's nuclear deterrent.
Members of the Campaign for Nuclear Disarmament (CND) greeted Prince William with chants of "shame on you" as he arrived at Westminster Abbey.
He was joined at the service by Penny Mordaunt, in her first official engagement as defence secretary.
Earlier, Ms Mordaunt praised the "incredible crews" who had manned the UK's nuclear submarines over the years.
She also announced the fourth of the new Dreadnought class submarines - which are replacing the existing Vanguard class submarines - would be called HMS King George VI.
Anti-nuclear campaigners gathered outside the abbey and staged a "die-in" - lying on the ground pretending to be dead - to commemorate victims of nuclear war.
Omar Ahmed, an activist from Nelson, Lancashire, said: "I'm surprised that he would come and support something that could destroy our planet."
CND's head Kate Hudson has described the commemoration as "disappointing".
Speaking to the BBC's Today Programme, she said: "A thanksgiving for nuclear weapons is completely inappropriate, and we're not alone in thinking this."
The memorial service was organised under Gavin Williamson before he was sacked as defence secretary following an inquiry into a security leak.
'Debt of gratitude'
By Martin Bashir, BBC religion editor
In a packed Westminster Abbey, with the Duke of Cambridge and newly installed Defence Secretary Penny Mordaunt seated close to the High Altar, the dean delivered a brief but pointed address.
Acknowledging that he had received a large amount of personal correspondence and emails asking him to cancel the service, he said he was "proud that it is taking place here in the abbey".
It was not a celebration of nuclear power, he said, for "we cannot celebrate weapons of mass destruction". But he added: "We do owe a debt of gratitude to those responsible for maintaining the peace."
Across the road from Westminster Abbey, a cluster of about 200 protesters stood quietly - holding banners which read "Trust in God not in Nuclear Weapons" and "Blessed are the peacemakers".
Musician Brian Eno joined protesters and asked: "Why are we wasting so much of our resources on weapons that we're never likely to use?"
The Chaplain of the Fleet, the Venerable Martin Gough, who offered the Naval Prayer during the service, said: "This was an opportunity to acknowledge the sheer sacrifice that naval personnel and their families have to make when they join the sea deterrent service."