Sigit Hariyanto and the other men on the life raft screamed as the ship got closer, daring to believe that five terrifying days of storms, hunger and ravishing thirst might soon be a memory.

"Help! Help! We are over here!" they shouted, standing and waving their arms.

But agonizingly, the ship turned away; no one on aboard saw the survivors from a sunken ferry floating in the vast expanse of ocean. The men fell silent, turning to dreams of their families or to prayer, the near-rescue only heightening their despair.

"After that I became resigned to my fate," Hariyanto said Tuesday, recounting the lowest point of a nine-day ordeal that ended Sunday when the raft was finally spotted. "God gave me my life. If he wanted to take it back, then I was willing to give it to him."

Although one man died shortly after the rescue, the survival of the 14 others on the raft was a rare piece of good news in Indonesia after a string of disasters, including deadly floods and landslides and the presumed crash of a jetliner.

The men were among nearly 630 people aboard a ferry that went down in the Java Sea during a violent storm Dec. 29. Nearly 400 people are dead or missing.

On the raft, the men endured monstrous seas that almost capsized their flimsy craft and forced them to hold on for hours in terror, shivering as temperatures fell at night and burning during the day in the tropical sun.

They survived on emergency rations stored in the raft, with each man limited to three servings of a fingernail-sized piece of biscuit and a sip of water each day.

After riding out the first three days of rough seas, the men — all Muslims from Indonesia's main island of Java — began performing solat together, the ritual of praying five times a day that is the cornerstone of the Islamic faith.

"It gave us all strength and made us more united," said Hariyanto, a 25-year-old who runs a small computer school on Indonesia's side of Borneo island, the ferry's departure point.

"After the prayers, I felt more relaxed," he said.

Like most survivors, Hariyanto was on an upper deck of the ferry Senopati Nusantara when it began listing just before midnight after being pounded by towering waves for several hours.

As the tilt became more acute, he held onto a railing, while others fell to the deck. One woman, screaming for help, clung to his leg before losing her grip and smashing into a wall now 30 feet below.

The lights went out and the ship sank. Hariyanto fought his way through a broken window into the churning sea. He stayed under water for around a minute, before he was spat up next to the life raft.

He and others who made it onto the raft — among them four crew members — initially thought they would be rescued quickly, but bad weather that hampered the search swept them hundreds of miles.

"After a few days I began to realize we were in deep trouble," said Hariyanto.

He said hunger was less of a problem than thirst, which was especially acute when the skies cleared. Occasional showers provided relief, with the men opening their mouths to the skies.

"When it rained it was like a river in heaven washing over us," he said, as nurses brought him hot sweet tea and bananas. "Just for that moment, our torture was suspended."

Less then 24 hours after being hospitalized on Sulawesi Island, Hariyanto looked thin but well, and he was already walking and smoking. Doctors said none of the survivors appeared to have serious health problems.

Indonesia's tropical waters are generally between 72 and 84 degrees. People have been known to survive days at sea, but only with something to keep them afloat. Hariyanto said that after the near miss on the fifth day, he and others began to doubt they would be rescued.

"People began sobbing to themselves," he said. "It was desperate."

Even as supplies dwindled, the men did not fight among themselves, he said, though there were occasional grumbles about an extra sip of water.

Rescue was sudden when it came.

Hariyanto was sleeping at around 8 p.m. — well after dark — when two men on watch saw the lights of a ship in the distance. "It is getting closer! It is getting closer!" one shouted. "Now it is turning toward us," the other said.

Hariyanto said he only believed he had survived when he heard the voices of ship's crew and the life raft was illuminated by a spotlight. He and the others on board fell to their knees and thanked God, he said.

Once on the ship, Hariyanto had a warm drink and a shower and called his mother, who tearfully told him she had already performed prayers for his soul, believing him dead.

"Allah gave us all a test and pushed us to our limit," he said. "And then he decided to save us."