The 37-year-old told police a current had pulled him out to sea off Bulli Beach, 80km (50 miles) south of Sydney on Thursday evening.
Sailors on the MSC Damla spotted him floating about 6km offshore and pulled him on board using a lifebuoy.
They gave him food, drink and warm clothing and contacted the authorities.
A pilot vessel from Port Kembla returned him to shore. He was taken to hospital but discharged shortly afterwards.
The man was in "remarkably good spirits", MSC Australia's managing director Kevin Clarke said.