PARIS -- A team of experts' final attempt to salvage a cargo ship that had been adrift off the coast of France for five days proved a tentative success on Monday, just hours before it could have run aground.

Broadcast images showed the dramatically listing, 538-foot Modern Express being towed by another ship via a cable on Monday afternoon. It was just 28 miles off the French coast. The rescuers' first goal was to tow it farther offshore before eventually looking for a safe harbor.

High winds and 20-foot waves made weekend rescue attempts impossible.

Get Breaking News Delivered to Your Inbox

Vice-Adm. Emmanuel De Oliveira of the Atlantic Maritime Prefecture said early Monday that the final effort to attach a towing cable to the 538-foot vessel, which is listing nearly 90 degrees, was to take place at dawn Monday. If it failed, he said, the vessel would have run aground in southwest France by Tuesday night.

In this Jan. 31, 2016 image released by the French Maritime Authority, a helicopter lowers an SMIT Salvage expert onto the Modern Express, the Panamanian registered cargo ship that was been abandoned off the French Coast. French Maritime Authority

Spanish helicopters evacuated the 22-member crew last Tuesday after the Modern Express, carrying 3,600 tons of wood and equipment, sent out a distress call.

The vessel had been drifting south and by Sunday afternoon it was 60 miles off the coast of the vacation town of Arcachon, south of Bordeaux. If not put in tow, it was expected to have run aground further south, in the Landes region, De Oliveira told a news conference.

Stricken cargo ship 'Modern Express' is seen in the Atlantic Ocean off France, Jan. 30, 2016, in a picture provided by France's Marine Nationale. REUTERS

He said he expected only "limited" environmental impact if the Panama-registered vessel had hit the coast because the cargo was mainly wood and there were no signs of leaking of its 300 tons of fuel.

Experts from the Dutch company Smit Salavage were called in to try to capture the drifting vessel, helped by two Spanish tugs and a French ship.

It is "totally impossible to put the cargo ship upright," De Oliveira said.