The Duke and Duchess of Cambridge have joined Sir David Attenborough for the naming ceremony of the polar research ship the public voted to call Boaty McBoatface.
That name was vetoed.
The ship was officially named the RRS Sir David Attenborough in a ceremony at the Cammell Laird shipyard in Birkenhead, Merseyside, today.
Attenborough, 93, was accompanied by daughter Susan as the nature presenter attended the ceremony to see the ship named in his honour.
Speaking before the naming ceremony, William said: "As last week's climate protests the world over and yesterday's report on our oceans and frozen regions demonstrated, there has never been a more important moment for this ship to get to work, and there is no person more fitting for this beacon of scientific research to be named after than you, David.
"You have shown us how awe-inspiring the natural world is, and also how fragile and endangered it is, and you have inspired us all to do as much as we possibly can to protect it.
"It is my immense privilege and relief to welcome Sir David Attenborough, rather than Boaty McBoatface, to speak."
Addressing crowds who had come to see the ship, Sir David said: "It's no news to any of you that the world is facing great, great problems and the most aware of that are the young people of today, who will inherit this world.
"Great problems require great research and facts in order to solve them.
"That's what this astonishing ship will be here to do, to find out the facts and find the science with which to deal with problems that are facing the world today and will increasingly do so tomorrow.
"There could be no more important function for any ship, anywhere in the world, than those which are going to be dealt with by this remarkable ship, at the cutting edge of science."
He said it was the "greatest possible honour" that the ship carries his name.
Kate, the ship's sponsor, formally named the vessel and a bottle of champagne was smashed against the hull to mark the occasion.
The duke and duchess were given a tour of the ship and met engineers, including young apprentices, who were involved in the build.
They also met scientists, schoolchildren and heard from the ship's captains and crew members about its ice-breaking capabilities and navigation systems.
Mackenzie Grieman, an ice core scientist with the British Antarctic Survey (BAS), and colleague Rob Mulvaney showed the royals ice core which is 85,000 years old.
Ms Grieman said: "You can hear the carbon dioxide in them as it crackles and pops."
She said carbon dioxide levels in ice core can be monitored and the levels today are the highest they have ever been.
As he held a piece of the core, William said: "It's quite hard to know how to treat an 85,000-year-old piece of ice that's melting in your hand."
More than 124,000 people voted to name it Boaty McBoatface in a public poll, but that name was vetoed and it was instead named after the broadcaster.
But Boaty lives on, in the form of a miniature, unmanned yellow submarine that will be on board the boat.
The RRS Sir David Attenborough, which cost around £200 million to build, is set to act as a "floating research fleet", allowing scientists to study the world's oceans and understand more about climate change.
It was built by shipbuilding company Cammell Laird to a Rolls-Royce design.
Housing state-of-the-art equipment, the ship will be available to the UK research community and allow scientists to remotely deploy robotic instruments to areas humans cannot access.
The vessel is set to replace two other polar research ships.
The RRS James Clark Ross, which is nearing the end of its 25-year lifespan, and the RRS Ernest Shackleton, which was returned to its owners GC Rieber this year after 20 years of service.