But the terrified crew of the 78ft Longo Barda, which came under attack in darkness as it arrived in Somali waters, had to wait for more than an hour for their rescuers to arrive.
The only woman member of the seven-strong crew on board the £1m yacht, which was making its way back to the Solent, was so frightened that she locked herself in the lavatory as the captain attempted to outrun the motorised dhow.
Numerous attacks on ships in Somali waters over the past year prompted the International Maritime Bureau, which set up a co-ordination centre to combat piracy, to issue a bulletin warning of the dangers.
The skeleton crew of the five-year-old yacht, which had been competing in the Sydney to Hobart race during the winter were returning from the Seychelles to the boat's home port of Southampton, when they noticed they were being followed by the dhow.
At about 10pm on Tuesday when the dhow came within about a quarter of mile, it fired five or six rounds from what the crew believed was a mortar and machine-guns, though none struck the yacht.
The Australian skipper, Neil Batt, immediately went below and sent out a mayday which was picked up by a tanker.
Meanwhile, the crew tried to outrun the dhow by turning on the engine to supplement the sails.
But the dhow maintained a watch on the yacht as the tanker stood by, and it was not until the Canadian frigate, Fredericton, arrived more than an hour later that it left the area.
The yacht, which is stripped down to the bare essentials necessary for racing and would have had little of value aboard, was escorted throughout the night by the Fredericton to safer waters near Djibouti.
The yacht's former first mate, Chris Sherlock, who spoke to the crew by radio after the attack, said: "They thought they were going to die. These pirates are desperate people. They don't take prisoners, so the crew were terrified when they came under attack."
Mr Sherlock, 26, of Hamble, Hampshire, left the boat last month and flew home to supervise repairs to another yacht, Ocean Leopard, which is also owned by Michael Slade, a businessman.
Mr Slade also spoke by radio to his crew. He said: "It was a horrific experience and they would almost certainly have been murdered but for the intervention of the Canadian navy."
A Canadian navy spokesman confirmed a small pirate vessel fired a mortar at the yacht off the Gulf of Aden and that their boat went to help.
The yacht, with a crew of two Britons, four Australians and a New Zealander, is expected to arrive in Southampton for repairs on 5 May.