Toakai Teitoi's brother-in-law died from dehydration and the 41-year-old policeman thought it was only a matter of time before he, too, would succumb.
Mr Teitoi said that an unexpected event led to his eventual rescue after the extraordinary encounter with a shark, the 'Daily Mail' reported.
"Just as I was giving up all hope of being rescued after one boat had passed me by in the distance something very strange happened," Mr Teitoi said after being brought ashore in the Marshall Islands by the fishing boat which found him.
"I was cowering from the sun under a piece of cloth I had stretched across the front of the boat when I felt a big bump, followed by some scratching," Mr Teitoi said.
"I looked over the side and saw a six-foot shark circling my boat, but it was mainly bumping against the hull. It definitely caught my attention because I had been fast asleep. Then, because I was now awake, I looked around me and saw the stern of a ship," said Mr Teitoi.
"I couldn't believe my eyes. I could just make out the crew who were looking at me through binoculars," he said.
"Of course I was able to wave frantically at them and they came and picked me up. If that shark hadn't nudged me awake the crew of the boat might have thought I wasn't in trouble and might have carried on sailing past me," Mr Teitoi added.
Mr Teitoi and his brother-in-law had flown from their home on the island of Maiana to the Kiribati capital of Tarawa. While returning, Mr Teito and his brother-in-law, Ielu Falaile, boarded a 15-feet wooden boat for what should have been a two hour voyage. They stopped to fish along the way and then dozed off and when they woke up, they had drifted out of sight of Maiana.
Soon after wards, they ran out of fuel. As the two men began to suffer from dehydration, Mr Teitoi turned to prayers, but his brother-in-law just lay in the boat and after five weeks adrift, Falaile died.