SALT LAKE CITY― For 49 days Aldi Adilang did not know if he would survive the nightmare that had become his reality.

But praying helped him through it.

According to The Washington Post, the Indonesian teenager was working as a lamp keeper on a small, floating fishing hut (known as a rompong) when a storm caused the line that tethered his raft in place to snap, sending Adilang adrift in shark-infested waters in the Pacific Ocean.

He would spend the next seven weeks fighting for his life, surviving only on fish he caught and sea water he filtered through his clothes.

According to Fox News, as the days went on, Adilang’s hope began to waver, and in his darkest moments he even thought of suicide.

But he would turn to his Bible as a source of strength. The New York Post reported that he read from the Bible every day.

Adilang also received strength by heeding some advice given to him by his parents: When desperate, pray.

More than once, the teen’s hopes of rescue were renewed at the sight of a passing ship. But these hopes were dashed as each time the craft would sail by Adilang, not noticing the teenager in distress.

“Every time he saw a ship passing by, the teen’s hopes lifted — but more than 10 vessels sailed right past him without seeing him, officials said. He cried while thinking of his family, fearing he would never see them again,” reported the New York Post.

But finally, Adilang’s prayers were answered.

“On Aug. 31, the bulk carrier Arpeggio sailed past Aldi, who waved his cloth again for help,” the Jakarta Post reported. “At first, the ship’s crew did not see him, so Aldi tuned his radio to a frequency a friend of his had once told him to use in case he is blown away and sees a large ship.”

Adilang has since been reunited with his family in Indonesia. He does not plan to return to his job on the rompong.