The Queen waved goodbye to the Royal Navy's largest operational warship following a decommissioning ceremony in Plymouth.
HMS Ocean, or the Mighty O as she is affectionately known, has been sold to the Brazilian navy for £84 million following 20-years of service.
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 - lady sponsor of the helicopter and amphibious assault craft - paid tribute to the "unique and remarkable vessel" during a speech at the formal decommissioning ceremony at Devonport Naval Base.
"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, from a dais on the jetty.
"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.
There was a 21-gun salute when the Queen - wearing a coat and dress by Stewart Parvin, hat by Rachel Trevor-Morgan and a diamond paisley brooch - arrived and departed the 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's colour - a double-folded silk White Ensign with crown and Royal Cypher - was raised on the ship.
Members of HMS Ocean's company were presented to the Queen for inspection before the parade removed their hats and gave 'Three Cheers for Her Majesty'.
Merlin, Chinnok, Sea King and Wildcat helicopters then performed a flypast.
The Queen was then driven up onto the ship, where she was hosted to lunch cooked by chef Carl Tester from Plymouth.
"I've cooked for lots of top people including the First Sea Lord, the top man in the Navy, which is big enough," he said.
"But the Queen is the peak of my career. You don't get any more important than that."
The starter was gin and tonic cured pollock, followed by roasted loin of Dartmoor venison and a dessert of layered white chocolate and vanilla panna cotta.
Following the private lunch, the Queen attended a reception on HMS Ocean with the ship's crew and their families.
Her Majesty The Queen today officially bid a fond farewell to HMS Ocean as the Royal Navy's 'Mighty O' was...
She spoke with Marretta Coleman, 65, from County Antrim in Northern Ireland. Mrs Coleman was at the decommissioning ceremony with her son, Lt Commander Gareth Coleman, 36, who lives in Newport, south Wales.
"She said it was such a sad day for the ship," Mrs Coleman said. "She also said that it was lovely to see the families here today."
HMS Ocean was commissioned in 1998 and members of the original company were present at the decommissioning ceremony.
Chief petty officer Paddy Ashe, from Belfast but now living in Yeovil, Somerset, introduced his wife Sarah and daughter Philippa, 18, to the Queen.
"When I came to the commissioning ceremony, my wife was pregnant with my daughter," CPO Ashe, a survivor of the Atlantic Conveyor sinking in the Falklands, said.
"The Queen said 'she was an Ocean baby'. It was a privilege to meet her."
Chief petty officer Andrew Margerison added: "It is a very sad day to be honest. It has had such illustrious service, in conflicts and humanitarian operations around the world so to see it go today is very disappointing."
Chief petty officer Sharky Ward, from Gloucester, brought his parents Trudy Paul and Melvin Ward to the decommissioning ceremony.
"I said to the Queen that it's like an addiction this ship - I can't stay away. She smiled," he said.
"This is my fourth draft on the ship in 10 years. I was honoured and flattered to make her smile. It's not every day you get the chance to shake hands with the Queen and make her smile."
The Queen was presented with the official decommissioning book for the ship, as well as gin distilled from water made onboard.
Commander Nick Wood, the ship's second-in-command, described HMS Ocean as her company's "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," he said.
"The ship that replaces HMS Ocean, HMS Prince of Wales, is much larger and has greatly increased advanced capability."