Two people were rescued from a yacht drifting near the busy Forth shipping channel without lights.
Their vessel lost power on Sunday night, plunging them into darkness off the coast of Burntisland.
Disaster was averted when volunteer rescuers were able to locate them and tow them safely to shore around 40 minutes after the alarm was raised.
A ship was travelling in the direction of the 23-feet long Dysart yacht but was warned of its presence by the Coastguard.
It is believed the boat was not equipped with a VHF radio and a 999 call was made by mobile phone.
VHF radio allows the Coastguard and lifeboat crews to communicate directly with vessels and to locate them.
Kinghorn Lifeboat, which performed the rescue, later issued a reminder to anyone taking a vessel to sea to ensure they have a reliable means of calling for help.
The rescue came at the end of a busy weekend of training for the Kinghorn volunteers.
Station spokesman Neil Chalmers said: “We were tasked just before 9.50pm on Sunday to reports of a yacht in trouble somewhere off Burntisland.
“We had to go out and locate it and make sure those on board were OK.
“There was a ship on its way down and there was a boat potentially in difficulty.”
The Coastguard triangulated the vessel to a point near Burntisland and the Forth pilot boat Forth Puma, which accompanied the lifeboat crew, found it around two miles south of the town.
The Kinghorn lifeboat then towed the yacht to the safety of Burntisland harbour.
A statement issued by the station afterwards said: “If you plan on taking a vessel to sea, we would always recommend that you ensure you have a reliable means of calling for help, preferably a VHF radio on board as this allows the coastguard and lifeboat to make contact directly, and use our VHF direction finding equipment.”