Maritime experts on Monday successfully managed to tow a stricken cargo ship away from France and prevent it from crashing into the country's picturesque Atlantic coast.
Louis-Xavier Renaux, a spokesman for local maritime authorities, said a Spanish tugboat had successfully been connected to the ship, which is tilting heavily, "and managed to pivot it, point it towards the open sea and begin towing it."
After seven days drifting in rough seas, the Panamanian-registered Modern Express was only 44 kilometres (27 miles) from the French coast when authorities launched a final bid to attach a tow line and stop it from hitting the coast.
Experts from Dutch company SMIT Salvage, which specialises in helping ships in distress, were lowered by helicopter onto the vessel as it tilted at 40 to 50 degrees while buffeted by large waves.
Renaux said the priority now was to distance the cargo ship from the coastline as much as possible in case the tow line snaps in the rough seas.
The ship's crew sent a distress signal last Tuesday after the vessel listed strongly to one side, probably due to its cargo coming loose in the hull.
The 22 crew were evacuated by helicopter as they clung to the ship.
Three earlier efforts to attach the tow line failed, with the cable snapping on Saturday due to the movement of the vessels in the rough seas.
"The difficulty is a combination of several things: the wind, the swell and the angle of the boat which is like climbing a mountain, but which is moving," a spokesperson for SMIT Salvage told AFP over the weekend.
Renaux said that if the tow line holds, the Modern Express could be pulled into a "refuge port" to be stabilised and straightened. Such a port had yet to be chosen, but could be in either France or Spain.
The Modern Express was carrying diggers and 3,600 tonnes of timber from Gabon in west Africa to the port of Le Havre in Normandy.
If the towing operation failed, the Modern Express would likely have crashed onto the coastline of the Bay of Arcachon, where it would have been dismantled or cut up.
With around 300 tonnes of fuel in its tanks, French authorities said there was a limited risk of pollution in the event of a crash.
However a clean-up vessel was sent to the scene just in case and coastal communities remained on alert.