The Queen has paid tribute to the Royal Navy's largest operational warship at a decommissioning ceremony in Plymouth.
HMS Ocean, or the Mighty O, as she is known throughout the fleet, has been sold to the Brazilian navy for £84 million.
She most recently carried out humanitarian work in the Caribbean following the devastation caused by hurricanes Irma and Maria in British overseas territories.
The Queen - the helicopter and amphibious assault craft's lady sponsor - was greeted with a 21-gun salute as she arrived at Devonport Naval Base.
She was guest of honour at the decommissioning ceremony, along with the head of the Navy, First Sea Lord Admiral Sir Philip Jones, and more than 500 of the ship's company and their families.
The Queen inspected a parade of the ship's company on the jetty before proceeding to the dais.
"We are gathered here in Plymouth today, in the midst of this city's rich maritime heritage, to say farewell to this unique and remarkable vessel, and to reflect on her considerable achievements," she said.
"Throughout her life, HMS Ocean has been at the forefront of global operations, bringing together the men and women of the Royal Navy, Royal Marines, Army and Royal Air Force in their common purpose of defending our nation's interests and spreading peace and prosperity across the world.
"It is a testament to the unique nature of this ship and her crew that her success on operations as an amphibious helicopter carrier, in Sierra Leone, Iraq and Libya, has been matched by her capacity to deliver vital humanitarian aid, from the very beginning of her career to her final deployment last autumn.
"With three generations of naval officers in my family, I recognise the significant demands that have been placed on all those who have served in the ship over the last two decades, as well as the contribution of their families and loved ones.
"As you all prepare to move on to new challenges I know that, like me, you will always treasure your memories of HMS Ocean.
"The Lord High Admiral, the Duke of Edinburgh, joins me in wishing you well in your future endeavours.
"The ship that replaces HMS Ocean, HMS Prince of Wales, is much larger and has greatly increased advanced capability."
The Queen, wearing a coat and dress by Stewart Parvin, hat by Rachel Trevor-Morgan and a diamond paisley brooch, observed a flypast of three Merlin helicopters, a Chinook, a Sea King and a Wildcat.
The ceremony concluded with the Royal Navy White Ensign being symbolically hauled down from the ship's main mast.
Members of the parade removed their hats and gave three cheers for the Queen.
HMS Ocean, commissioned in 1998, officially leaves service with the Royal Navy this week after 20 years of service.
Commander Nick Wood, the ship's second-in-command, said: "This is a sad day for us all. This is our home when we are away.
"But while we will miss HMS Ocean we mustn't let emotion cloud the bright future for the Royal Navy or stand in the way of progress."