About 400 migrants have been rescued by local fishermen in the Strait of Malacca, off Indonesia's Aceh province, after their stricken boat was reportedly turned away numerous times from the Thai and Malaysian coasts by authorities.

Wednesday's rescue occurred just hours before the governments of Malaysia and Indonesia issued a statement saying they would "continue to provide humanitarian assistance to those 7,000 irregular migrants still at sea" and offer them temporary shelter, provided they were resettled and repatriated within a year.

Khairul Nova, a search and rescue official, said the rescue took place at 2am local time on Wednesday (19:00 GMT Tuesday) and those saved included woman and children.

Those rescued were taken to Simpang Tiga village in East Aceh district, he said.

Al Jazeera's Step Vaessen reported that the rescued boat was the same one that made international headlines last week when it was found floating off Thailand's coast, after its captain and crew had apparently fled.

Witnesses in Aceh said that many of the rescued migrants were in tears when they made it to land, with many very sick and weak.

Migrants told Al Jazeera they had been sent away by the Thai navy on three occasions and Malaysian authorities twice.

The second time they were rebuffed by Malaysian authorities, they say they were held at gunpoint and told that their ship would be bombed if they did not turn around.

"This boat had been spotted by journalists (off) Thailand on Thursday last week. People on board were then already in a desperate state," Vaessen said.

"Those thousands still at sea have not much time to lose."

About 1,500 Muslim Rohingya from Myanmar, fleeing persecution, and Bangladeshis, seeking to escape grinding poverty, have already arrived in Aceh in recent days after being abandoned by people smugglers.

They are among several thousands who have made it to land in Indonesia, Malaysia and Thailand after being dumped by smugglers following the disruption of long-established human-trafficking routes.

Malaysia's foreign minister hosted his Indonesian and Thai counterparts on Wednesday for urgent talks on the refugee crisis, with pressure mounting on them to help thousands of starving refugees.

The three nations have sparked outrage by turning away vessels overloaded with migrants.

RELATED: Philippines may open doors to Rohingya migrants

In the statement issued after the talks, the three government agreed to "continue to uphold their responsibilities and obligations under international law".

The statement did not say that Thailand would join Malaysia and Indonesia in providing temporary shelter to the thousands of migrants still believed to be drifting on boats in the Strait of Malacca and nearby international waters.

"[We] call upon the international community to uphold their responsibility and urgently share the burden of providing the necessary support to Malaysia, Indonesia and Thailand in addressing the problem," the statement said.

The three countries requested financial support to provide shelter to the migrants and said "the international community will take responsibility for the repatriation of the irregular migrants to their countries of origin or resettlement to third countries within ... one year".

Myanmar said on Wednesday it was "ready to provide humanitarian assistance" to refugees, in its most conciliatory comments yet.