The skipper of a small fishing boat had to swim to shore after falling overboard in the North Sea.
And as he was being taken to hospital a mission was launched to stop his vessel crashing into supply ships.
The creel boat was heading for Aberdeen Bay on autopilot and had to be intercepted by a team from a marine services company.
The RNLI said the fisherman had to swim for 20 minutes to reach safety after going into the water off Boddam, south of Peterhead.
He was suffering from hypothermia and was taken to Aberdeen Royal Infirmary for a check-up.
The Peterhead and Aberdeen lifeboats were both launched after the alarm was raised.
They were joined by the crew of a Greenhowe Marine Services’ vessel who heard a radio call for help.
A spokesman for the company group said: “We were in the shore of Aberdeen harbour and we heard about the incident on the VHS radio, and that the coastguard was in need of assistance.
“Our crew went out and managed to get on board the fishing boat and one of our crewmen took it back into Aberdeen harbour.
“The boat was between Ythan and Balmedie and was heading towards supply boats and would have caused a lot of damage had it not been stopped.
A spokesman for Aberdeen RNLI said: “Aberdeen RNLI all-weather lifeboat the Bon Accord and Peterhead all-weather lifeboat the Misses Robertson of Kintail were launched at 2pm after reports of a man overboard.
“The skipper of the creel boat from Peterhead managed to swim to shore and was taken to hospital for a check-up.
“The creel boat, which was on autopilot, was heading for Aberdeen bay and both RNLI lifeboats were tasked to intercept it before it caused any problems to shipping.
“Fortunately, a local crew transfer boat managed to get someone on board just as the lifeboats arrived on scene and made the creel boat safe.”
The fisherman has not been named but is understood to be from the Peterhead area.