Viking Grace, a passenger ferry with more than 400 people on board was towed to quay early on Sunday, the day after it ran aground in the Finnish Aland Islands archipelago.
The 331 passengers and 98-strong crew spent the night on the ferry, which ran aground just a few hundred metres from the ferry terminal in Mariehamn, the archipelago's main town.
Tugboats pulled the vessel - which was just a few metres from the shore - off the shallows and towed it to the terminal.
Passengers disembarked and were registered at the terminal. They were later to be allowed back on the ferry, where they would be informed which vessels would transport them to Finland and Sweden.
The ferry was en route from Stockholm via Mariehamn to Turku, Finland.
There were strong winds and it was raining hard on Saturday. Several other ferry services did not operate.
Powerful wind gust
Viking Line chief executive Jan Hanses earlier told Finnish public broadcaster YLE that it appeared that a powerful wind gust had blown the vessel towards the shoreline where it ran aground.
Built in 2012, the 218-metre long Grace can transport 2,800 passengers.
Viking Grace would in the coming days sail to Turku Repair Yard for inspection. No leaks were reported from the vessel and initial inspections by divers had not shown any sign of damage.
In September, another Viking Line vessel, Amorella, ran aground in another part of the Aland Islands' archipelago.