The Duchess, in her last public engagement before giving birth, was introduced by the captain of the new ship, Tony Draper, who asked: "Duchess, will you name my ship?"
The Duchess then christened the ship with the words: "I name this ship Royal Princess. May God bless her and all who sail in her."
She then cut the ribbon to release the giant Nebuchadnezzar-sized bottle of Moët & Chandon Champagne, which smashed against the hull of the ship. It was followed by a blast of confetti and streamers, which covered the assembled crowd.
Twenty-nine years ago, Princess Diana had done the same thing with a previous Royal Princess ship.
The Duchess arrived at 11:35 a.m., local time (GMT) in a black Range Rover and walked the few yards to the podium on the quayside in front of the ship.
Security was tight throughout the event: Police patrol vehicles were stationed along the quayside, and police and sniffer dogs had been onboard earlier in the morning.
The ceremony began with the playing of the Pipers of the First Batallion Irish Guards and The Band of Her Majesty's Royal Marines Portsmouth.
After the Duchess' arrival, former chart-topper Natasha Bedingfield sang, followed by a group called Mass Ensemble, featuring Broadway star Kerry Ellis.
This was followed by a welcome from the president and CEO of Princess Cruises, Alan Buckelew, who said: "We are delighted to name this new ship in Southampton, because this company's connections to Britain are strong.
"For 30 years Princess was part of the line (P&O) which ‘invented' cruising in 1837. When we first conceived Royal Princess we knew she would be an exciting addition to the Princess fleet.
"Our idea was to take the most popular features of our other ships -- the Piazza, Movies under the Stars -- and add new features such as the SeaWalk, the TV studio and the biggest pastry shop at sea.
"Passengers will find Royal Princess both familiar and welcoming and innovative and exciting."
Buckelew then welcomed the Duchess with the words: "We are incredibly proud that Her Royal Highness the Duchess of Cambridge will officially name this ship today.
"The godmother to a ship is the figurative patron of the ship its entire life and signifies the spirit of the vessel.
"We can think of no better godmother to this ship than the Duchess of Cambridge -- an ambassador for Britain who is admired for her style, grace and compassion around the world."
The Duchess also toured the new ship.
Planned fireworks the night before did not take place due to bad weather. Passengers stayed inside instead to watch soul singer Beverley Knight and the Beatlemaniacs play in the ship's main Piazza area.
Other celebrities onboard included TV presenter Ben Fogle and Olympic rower James Cracknell, as well as Sir Bruce Forsyth and Christopher Biggins.
The ship sets sail tomorrow on a short cruise to the Channel Islands before heading back to Southampton, then onto Barcelona, where it will spend the summer season.
--by Adam Coulter, U.K. Editor