The Queen paid tribute to Sunderland's adopted warship at a special decommissioning ceremony in Plymouth today.
HMS Ocean, or the Mighty O, as she is known throughout the fleet, was the Royal Navy's largest operational warship until HMS Queen Elizabeth entered service last year.
The helicopter and amphibious assault craft, which was built on the Ryver Clyde and fitted out at Barrow, has been sold to the Brazilian navy for £84million.
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 today.
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.
HMS Ocean was Sunderland's adopted warship for more than 20 years, and paid her last visit to the city in July 2017.
She spent six days on the river which reached their emotional climax when 240 sailors and Royal Marines marched through the heart of the city, bringing shoppers to a standstill.
The Mayor of Sunderland, Coun Doris MacKnight, told the massed ranks in front of her at the war memorial in Burdon Road: "Everyone in Sunderland has always been very proud of their links with HMS Ocean.
"Over the years, HMS Ocean has had magnificent crews, she is a magnificent ship, and her size, importance, and status has been reflected in her role as the Royal Navy's flagship. Sunderland's affiliation with HMS Ocean is a very proud one."
Today, as the Navy said goodbye to its former flagship, 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 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 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."