The yacht, one of the city’s biggest tourist attractions, developed a leak in a door seal, with the water pouring in, causing it to list to starboard.
While the cause of the leak is not clear, it is thought a lower door seal may have buckled when the ship was moved.
It had been due to go to dry dock yesterday for an inspection and repainting, ahead of a packed year of events to mark the Queen’s Diamond Jubilee.
But it took far longer than expected to move the giant vessel, after she started listing badly because of the leak.
Fire crews had to be called in to pump water from the Royal Yacht, and it wasn’t until the afternoon that it was finally deemed safe enough to tow her to Leith Harbour.
A spokesman for Britannia said she was pulled by a tug and arrived at about 3.30pm. He said Britannia was now securely tied up and an investigation would be carried out into the leak.
He added: “Moving the yacht obviously took longer than expected after suffering a setback but it is now mission complete.
“It all went smoothly once the water was pumped off the boat and it started to move. So all’s well that ends well.”
There was not thought to be any damage to the yacht. All her contents had been removed before the move began.
Britannia served the Queen for 44 years and 968 official voyages before being taken out of service in 1997.
In July, the Queen’s grand-daughter Zara Phillips and England rugby star Mike Tindall hosted a pre-wedding party on board, which was attended by Princes William and Harry and the Duchess of Cambridge.
Bob Downie, chief executive of the Royal Yacht Britannia, said: “When we were removing the mooring ropes this morning, the ship moved four degrees to starboard.
“This meant that new access watertight doors to our pontoons were below the water level. There has been a leak in the seals in those doors which was accentuating the list.”
He said limited shore power meant the fire brigade was called to help pump water off.
Four fire engines and three other fire service vehicles arrived at the scene after the call was made shortly after 11am.
About 20 firefighters pumped water from the vessel to allow it to make the journey to the neighbouring Imperial Dry Dock, also in the Port of Leith, for work to be carried out.
A major part of the work is painting the area of the hull, which is below the waterline.
Britannia has to be taken out of the water and into the dry dock to allow that part of the hull to be inspected, treated and then repainted. It is the first time since the summer of 1998 that it has been done.