Engineers in Italy have succeeded in setting the cruise ship Costa Concordia upright, 20 months after it ran aground off the island of Giglio.
They said that the unprecedented salvage effort "reached degree zero [vertical], which was our target".
In the operation that took all of Monday and most of the night, they used cables and metal water tanks to roll the ship onto a platform.
The Costa Concordia capsized in January 2012, killing 32 people.
The bodies of two of the victims of the disaster, by the island of Giglio, have never been found. There are hopes that they may be located during the operation.
Months of work lie ahead, assessing and repairing damage to the ship, before it can be towed away to be destroyed - probably next spring.
The ship was declared completely upright shortly after 04:00 local time (02:00 GMT) on Tuesday.
Franco Gabrielli, the head of Italy's Civil Protection Authority, said the vessel was now sitting on a platform built on the sea bed.
"A perfect operation, I must say," said Franco Porcellacchia, leader of the technical team for Costa Cruise, the owner of the ship.
He added that no environmental spill had been detected so far - one of the main aims given the pristine waters of the marine sanctuary in which it capsized.
"I think the whole team is proud of what they achieved because a lot of people didn't think it could be done," said salvage master Nick Sloane.
When the vessel was finally righted in the early hours of Tuesday morning, there was a giant cheer from people gathered at Giglio harbour, says the BBC's Matthew Price, and rescue workers have been out celebrating with coffees.
As daylight broke, the now-upright, brown hulk of the ship was visible - its starboard side muddy and crushed from 20 months spent submerged.
Booms and nets were put in place before the operation started - to combat any pollution threat in what is a marine national park.
The 114,000-gross tonnage ship was on Monday raised from rocks on which it had been lying and roll up onto her keel.
More than 50 enormous chains and winches were used to break the ship away from the reef - the process known as parbuckling.
Metal water tanks - caissons - were attached to the exposed side of the ship and filled with water to help right the vessel.
During the marathon operation, the ship could be seen slowly emerging from the water.
The engineers had originally planned to complete the operation by Monday evening, but it had to be delayed by three hours because of a storm.
The procedure was carried out very slowly to prevent further damage to the hull, which spent months partially submerged in 15m (50ft) of water and fully exposed to the elements.
Officials now plan to fully inspect the vessel and begin to prepare the next stage - the effort to repair and refloat it and eventually tow it away to be destroyed.
"It's not over yet," said salvage master Mr Sloane.
Engineers have never tried to lift such a huge ship - over 951 feet long (290m) - before.
Five people have been convicted of manslaughter over the disaster. The captain, Francesco Schettino, is currently on trial accused of manslaughter and abandoning ship.
Giglio mayor Sergio Ortelli earlier said that the removal of the Costa Concordia would bring an end to "a huge problem that we have in our port and that we want to solve as soon as we can".
"Islanders can't wait to see the back of it," he said.
The small island's economy depends hugely on tourism and the presence of the wreck has discouraged visitors.
The salvage project has so far cost more than 600m euros ($800m; £500m) and is expected to cost much more before the operation is complete.