LONDON — A cruise ship that set out with more than 1,300 people but became stranded off Norway’s coast finally reached the shore on Sunday afternoon, after rescuers launched a harrowing operation in rough weather to evacuate hundreds of people one by one by helicopter.

More than 890 people — 436 passengers and 458 crew members — were left on the 47,800-ton ship, the Viking Sky, as it headed to Molde, a coastal town in western Norway. On Sunday about 4:30 p.m. local time, after about six hours of traveling at sea with one tugboat in front and another in the rear, the vessel docked.

In footage shared on Twitter, cheers and whoops could be heard from onshore.

“It has reached Molde; everything has gone according to plan,” Einar Knudsen, a spokesman for the Joint Rescue Coordination Center for Southern Norway, which led the rescue operation, said by phone on Sunday.

Earlier, some passengers, who were airlifted from the ship’s deck, had arrived onshore bruised and battered, the Red Cross said. Passengers told NBC News that many had been hurt by falling objects and shattered glass as waves rocked the ship.