A teenager from Indonesia working as the solo lamp keeper aboard a wooden raft was rescued just off the coast of Guam after drifting in the ocean for seven weeks, reports the Jakarta Post.

Aldi Novel Adilang, 19, was first swept out to sea on July 14 after a strong wind snapped the line that anchored his fishing raft, called a “rompong,” which was positioned 78 miles out into the Pacific Ocean. Adilang was at the mercy of the currents and waves as he had no way to steer himself back, as the raft is not powered by an engine and has no other instruments to control its movements.

“I thought I will never meet my parents again, so I just prayed every day,” Adilang told the Associated Press.

Adilang ran out of food after a week and survived by eating fish and drinking partially-filtered seawater, he said.

“After he ran out of the cooking gas, he burned the rompong’s wooden fences to make a fire for cooking,” Mirza Nurhidayat, Indonesia’s consul general in Japan, told the Jakarta Post. “He drank by sipping water from his clothes that had been wetted by sea water.”

According to the AP, Adilang’s six-month contract with his employer required him to use a lamp at night to capture fish. It is a lonely job, they note, as the rompong’s are positioned so far out into the ocean that they can’t be seen from shore and other rafts are miles away. Supplies are usually dropped off once every seven days, and he was only left with a gas stove, utensils and a generator.

“I was on the raft for one month and 18 days. My food ran out after the first week,” said Adilang.

At one point, Adilang says he was even followed by a shark.

“I could only pray that the shark went away,” he told TribunManado news, according to NBC.

Adilang found himself using the lamp and walkie-talkie to try to signal passing boats during the 49 days he was afloat, but each boat passed by with no idea the trouble he was in.

“Aldi said he had been scared and often cried while adrift,” Fajar Firdaus, a diplomat at the embassy in Japan, told the Jakarta Post. “Every time he saw a large ship, he said, he was hopeful, but more than 10 ships had sailed past him, none of them stopped or saw Aldi.”

Finally, a Panamanian-flagged vessel spotted Adilang off the coast of Guam, almost 1,200 miles from his original position. Adilang used his walkie-talkie to radio “help” to alert the crew, who fed him and cut his hair once they got him aboard.

The vessel transported Adilang to Japan (their original destination), and he was finally reunited with his family on September 8.

Adilang no longer wants to work on a rompong, he told the AP.

This article originally appeared on PEOPLE.COM.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.