Monday 14 November 2011 04.46 EST
First published on Monday 14 November 2011 04.46 EST

Salvage crews are preparing to remove containers from a cargo ship that ran aground on a New Zealand reef nearly six weeks ago after pumping all remaining oil from the vessel and averting an environmental disaster.

Government ministers and local politicians hailed the work of the teams after they managed to remove all but a few traces of oil from the Liberian-flagged Rena, which ran aground off Tauranga, in North Island's Bay of Plenty, in heavy seas on 5 October.

But the Rena stayed intact as salvage workers spent weeks pumping the heavy fuel oil from its tanks to an adjoining tanker, and this process was almost complete, Maritime New Zealand said on Monday.

The next stage of the operation would involve a crane barge being put into position to begin the tricky job of removing cargo containers from the ship.

An accompanying shoreline cleanup has been sufficiently successful for local beaches to be expected to reopen later in the week.

The country's prime minister, John Key, said the operation had been "very, very successful", the New Zealand Herald reported. "I think the people of Tauranga will be very happy they haven't had the environmental disaster that some predicted," Key added.

The local mayor, Stuart Crosby said: "The salvors have done an amazing job under treacherous conditions to avoid an environmental disaster. I guess we've all gone through a series of emotions that we all do in this type of event. There has been disbelief, frustration, anger, and now relief – relief that the oil has been taken away by these great people."

However, the operation to remove the containers remains long and risky, Maritime New Zealand said. It is likely to take several months, during which time the Rena could still break up.

"The salvors are taking this time to make sure that all the equipment and systems are ready and working properly before commencing operations. They also need good, calm weather to operate effectively, with safety being the top priority," the salvage unit head, Arthur Jobard, said.

"Once the testing has been successfully completed, the salvors will be lowering men down in a cage to ready the containers for removal.

"However, as we have seen with this entire operation so far, the speed at which the salvage team can work depends on many different factors. This includes weather and how complex it proves to be to access the containers, many of which are badly damaged and in very precarious positions."

He said this meant it would be "impossible to predict exactly how long it will take to safely remove all of the containers on board – but realistically, it is likely to take several months of patient and careful work".