The alarm was raised at 9.30pm on Wednesday when the man got into difficulty at Fethaland in Shetland.
Coastguard rescue teams from Lerwick and Hillswick went to the scene and the man was brought to safety in a rope rescue, while Aith RNLI lifeboat stood by.
He was then winched into the coastguard helicopter and flown to Gilbert Bain Hospital in Lerwick to be checked over.
The man was not thought to injured but was very cold after several hours outside.
The rescue concluded at around 1am.