When the United States said it would not let people from the Philippines into the United State, the United Kingdom was more than happy to take them in.
But after President Donald Trump said it was OK to deport them, India and the Philippines agreed to allow them in on Monday.
The move is likely to increase tensions between the countries and is unlikely to resolve the underlying issue of who has a right to enter the US, the BBC’s Jonathan Head reports from New Delhi.
More from the BBC News article India has long been reluctant to allow immigrants from the island of Mindanao into its territory, because the islands are not recognised as countries.
But this was the first time the two countries agreed to take in foreigners, after US Secretary of State Rex Tillerson announced his intention to revoke visas for them.
India’s foreign ministry said it will provide “full cooperation” with US immigration officials to help them monitor and deport the Filipinos, who have been in the US since at least 2015.
Indian Prime Minister Narendra Modi was in New Delhi on Sunday for the inauguration of a major wall along the India-China border, with officials saying the wall will deter illegal immigration.