Crew on a Fugro research ship restored power just as their vessel was drifting into shallow water off the UK.
The 1,500-gt Fugro Mercator (built 1969) was having repairs carried out to its engine when it dragged its anchor in Margate roads off Kent on Wednesday morning.
A local lifeboat stood by for an hour while engineers battled to restore power as the ship headed for rocks in depths of less than 10 metres.
The