Dunbar’s RNLI lifeboats were launched as part of a multi-agency operation to assist a boat with engine failure.
The coastguard helicopter, fire and ambulance crews all also attended a call-out to a pleasure craft, at 10.35am on Saturday.
The three-man crew suffered engine failure 200 metres north-east to the entrance of Dunbar Harbour.
As the inshore lifeboat (ILB) prepared to tow the boat back to the harbour, the ILB also suffered engine failure.
The all-weather lifeboat (ALB) launched from Torness Power Station to assist, coastguard teams from Dunbar and North Berwick monitored the situation as the stricken pleasure craft began to drift towards rocks.
However, two kayakers helped guide the vessel away from danger. A UK Coastguard Rescue helicopter from Inverness, which was already airborne, attended the scene as a support option and North Berwick lifeboat was also tasked to help.
When the ALB crew arrived on scene at 12.30pm they set up a tow with the boat and returned it safely to Dunbar Harbour. The crew then assisted the ILB and by 1pm had safely towed the lifeboat back to the harbour.
Dunbar ALB coxswain Gary Fairbairn said: “What should have been a routine shout became a little more problematic when our lifeboat unexpectedly suffered a mechanical failure. Our crews are trained to deal with any eventuality and handled the situation well.
“All the agencies worked together to ensure things didn’t get out of hand.
“We are especially grateful to the two kayakers who were on scene to help move the vessel away from rocks until we arrived and to our colleagues in North Berwick who also launched to help if needed.”
The ALB returned to Torness at 1.30pm where it was readied for service. The ILB has since been fully repaired and is also back on service.