More than 430 Rohingya and Bangladeshi migrants who had been stranded at sea have been rescued by Indonesian fishermen and brought ashore to safety.

The boat is the vessel that had been missing for three days after being spotted off Thailand, according to AFP journalists who later boarded the boat. Thai authorities had turned the boat away, saying the migrants wanted to travel to Malaysia. All contact with the vessel and its occupants was then lost.

One of the fishermen who led the rescue was 40-year-old Razali Puteh. He said he and others were fishing about 37 miles (60 kilometres) off the coast of Indonesia's Aceh province when they saw the overcrowded trawler about two miles away. The vessel was crammed with people who were screaming, waving their hands and clothes at him to get his attention.

As he neared the trawler, people aboard began jumping into the water, trying to reach his boat. He said he asked them to stay on their boat, which apparently had no motor, and promised to return with help. He then returned with other fishing boats and brought the migrants to shore.

He says: "I could not have let them die, because they are also human beings, just like me. I am grateful to be able to save hundreds of lives."

They were taken to a local port where they were given food, water and medical checks.

"They were suffering from dehydration, they are weak and starving," said Khairul Nove, head of Langsa Search and Rescue Agency in Aceh province.

One of the rescued migrants, Ubaydul Haque, 30, said the ship's engine had failed and the captain fled, and they were at sea for four months before the Indonesian fishermen found them. "We ran out of food, we wanted to enter Malaysia but we were not allowed," he said.

Asranal Ali from Myanmar said: "We went on the boat to look for a Muslim country, either Malaysia or Indonesia, it doesn't matter what country as long it's a Muslim country."

Sirajul Islam, a Rohingya migrant, said that the Thai navy, after giving them provisions, pushed the boat away "within 10 minutes, otherwise they would shoot our ship".

Hasan Ali, a Rohingya Muslim from Myanmar, said they were forced to leave by Buddhists. "We could not refuse. Otherwise, we were beaten." Once they were at sea, "the captain and his companions escaped with a lifeboat."

Smugglers have abandoned ships full of migrants, many of them hungry and sick, following a crackdown on human trafficking in Thailand. More than 3,000 migrants have landed in Indonesia and Malaysia this month after weeks of drifting in the Andaman Sea with little food or water.

In a potential breakthrough in Southeast Asia's humanitarian crisis, Indonesia and Malaysia have offered to provide temporary shelter to thousands of migrants stranded at sea, but made it clear they would take no more.

"What we have clearly stated is that we will take in only those people in the high sea," Malaysian Foreign Minister Anifah Aman said. "But under no circumstances would we be expected to take each one of them if there is an influx of others."

"I urge all NGOs, of all races and religions to step forward to volunteer to help these Rohingya migrants," Malaysian Home Minister Ahmad Zahid Hamidi said. "Even though they are a migrant community that is trying to enter the country illegally, and breaking immigration laws, their well-being should not be ignored."

However, Thai Deputy Defence Minister Udomdej stressed that Thailand was not a destination. "It is not the country the Rohingya want to go to ... if they enter Thai waters, we will send authorities to see if they are hurt or ill. If they are ill, we will bring them to nurses. If they want to go on to a third country, then they can. We cannot force them to do anything."

The International Organisation for Migration has welcomed the decision by Malaysia and Indonesia to accept the boat people fleeing Myanmar and Bangladesh. However, the agency's spokesman Joe Lowry said: "There's a huge body of water and only a small number of boats, and the more time goes on without good search and rescue, the more desperate their conditions are going to become."