A 62-year-old French man survived for 16 hours at sea by using an air bubble inside his boat after it capsized.
The 12-metre vessel, which had set sail from Portugal's capital Lisbon, sent out a distress signal late on Monday evening from the Atlantic Ocean.
The man's survival was "verging on the impossible", said coastguard divers.
His boat sent a distress signal at 20:23 local time on Monday, 14 miles (22.5 km) from the Sisargas Islands, near Spain's north-west Galicia region.
A rescue ship carrying five divers as well as three helicopters set off to find and rescue the man, who has not yet been named.
A diver was winched onto the ship's hull to seek signs of life and the man responded by banging from inside.
The sea was rough and the sun had gone down, so the rescue team attached buoyancy balloons to the boat to stop it from sinking and waited until morning.
The man then jumped into freezing water and swam under the boat towards the sea's surface.
In a tweet, Spain's Maritime Safety and Rescue Society said: "Each life saved is our biggest reward."
Vicente Cobelo, a member of the coastguard's special operations team, said the sailor got into the water "of his own initiative" .
But, Mr Cobelo added, divers helped pull the sailor out, as it was difficult for him to get out of his suit.
He was airlifted by the rescue team and briefly taken to hospital for checks.