Indonesia and Malaysia will provide temporary shelter to thousands of migrants who had been stranded at sea, marking the first breakthrough in the humanitarian crisis confronting south-east Asia.
Most of the migrants are the persecuted Rohingya Muslim minority from Burma and others are Bangladeshis fleeing poverty.
The agreement came as more than 430 migrants who had been stranded at sea for months were rescued and taken to Indonesia.
"Indonesia and Malaysia agreed to continue to provide humanitarian assistance to those 7,000 irregular migrants at sea," Mr Anifah told reporters.
He said the two countries "also agreed to provide them temporary shelter provided that the resettlement and repatriation process will be done in one year by the international community".
Hundreds of Rohingya and Bangladeshi migrants have been brought to shore in Indonesia's northwestern Aceh province, Reuters reported, citing a search and rescue official.
"In total we found around 500 people out at sea and they are being brought to land in smaller boats," Khairul Nova, of the national search and rescue agency, said.
Over 350 migrants have been brought to shore by local fishermen in the town of Kuta Binje and are being registered by immigration authorities, a witness told the news agency.
The latest group brought to shore adds to the over 2,000 who have managed to land in Indonesia and Malaysia after weeks of drifting in the Andaman Sea with little food or water.
More than 100 migrants have been brought to shore by fishermen in Indonesia's northwestern Aceh province, Reuters reported, citing a search and rescue official.
"Nearly 400 more have been sighted at sea and fishermen are attempting to bring them to land," Khairul Nova, of the national search and rescue agency, said.
Nova said the Rohingya and Bangladeshi migrants had landed in the town of Kuta Binje in Aceh.
The latest group brought to shore adds to the nearly 1,400 who have managed to land in Indonesia after weeks of drifting in the Andaman Sea with little food or water.
Malaysia has launched a series of high-level talks with its neighbours to seek a solution to the deepening refugee crisis in the region.
The UN High Commissioner for Refugees believes there are up to 8,000 migrants on "boats in the Andaman Sea" trying to reach land.
Malaysian foreign minister Anifah Aman met with his counterpart from Bangladesh ahead of meetings with the Indonesian and Thai foreign ministers in the coming week.
Malaysia is the current chair of the 10-nation Association of Southeast Asian Nations, which has been criticised for long ignoring the plight of Rohingya Muslims fleeing persecution in Burma.
Myanmar has said it is not to blame for the escalating migrant crisis in the Andaman Sea.
More than 2,000 migrants have arrived in Thailand, Malaysia and Indonesia in recent weeks, with thousands more believed to be currently adrift at sea after tougher action on human traffickers led some captains and smugglers to abandon their boats.
While some are Bangladeshi economic migrants, many of those aboard the boats are Rohingya Muslims fleeing persecution in Myanmar.
However, Major Zaw Htay, director of the office of the country's president, told the Associated Press: "We will not accept the allegations by some that Myanmar is the source of the problem."
He also said that Myanmar's government would not attend a meeting called by Thailand on the crisis "if 'Rohingya' is mentioned on the invitation", accusing governments of trying to divert attention from their own human smuggling and slavery problems by blaming his country.
An official for the UN High Commissioner for Refugees has said that up to 8,000 people are on "boats in the Andaman Sea".
UNHCR official Jeffrey Savage said: "We understand there as many as 8,000 or more we don't really know who are still on boats out in the Andaman Sea.
"UNHCR has called on the international community particularly the countries in the region to undertake a massive search search and rescue operation to bring those people to shore, give them the same kind of assistance and humanitarian supports that we giving in this groups."
A boat full of migrants has been towed out to sea towards Indonesia and away from its southern islands in the Andaman Sea by the the Thai navy, a witness said. The boat was being towed southwest by Thai navy patrol boat number 911, the witness told Reuters.
The navy was unable to confirm if the boat was the same one it towed out of Thai waters on Friday. Thousands of migrants are adrift in Southeast Asian waters, abandoned by people smugglers in the Andaman Sea following a Thai crackdown on human trafficking.
More than 700 migrants who were stranded on a boat in south-east Asian seas after being turned away by Thailand and Malaysia have been rescued.
The migrants from Myanmar and Bangladesh were brought ashore to the east coast of Aceh on Indonesia's island of Sumatra this morning, a search and rescue official said.
"The latest information we have is about 794 people were found in the middle of the sea and brought ashore by fishermen at 5am," Khairul Nova, the official in the town of Langsa in Aceh, said.
"They are now in a warehouse by the port as a temporary arrangement," Nova added.
Thousands of migrants are stranded on similar boats in Southeast Asian seas as governments in the region seek to prevent them from landing, despite a UN request to rescue them.
Crisis erupts as Thailand refuses entry to 300 Rohingya migrants found drifting on an abandoned boat in its waters.Read the full story ›
Nearly 600 migrants, thought to be Rohingya refugees, were rescued from two wooden boats stranded off the coast of Indonesia's northern Aceh province, authorities said.
"There are 573 people, 424 men, 98 women and the rest children," said North Aceh police chief Achamdi. "About 50 of them have been brought to the hospital because of weak health."