Mexico apprehended about 1,000 migrants after President Trump threatened to slap tariffs on the country over its lax border policies.

About 200 Mexican military police intercepted the caravan walking north along a highway in southern Mexico on Wednesday, according to the Associated Press. The migrants told officers they planned to travel to the U.S. and claim asylum.

Some migrants resisted and others fled into the forest on either side of the highway, but the vast majority of those in the caravan complied with orders from Mexican officials. Hundreds of migrants agreed to go to a migrant detention center.

At the detention center, the migrants will be processed and, if needed, be transported back to their home countries.

The mass arrest comes days before Trump plans to place 5% tariff on all Mexican imports. Last week, Trump threatened Mexico with tariffs starting at 5% on June 10 and increasing 5% each month up to 25% until Mexico restricts the flow of migrants traveling through it to the U.S.

Mexican President Andrés Manuel López Obrador is answering Trump’s call for stricter border security. López Obrador has sent a delegation to meet with White House officials and appears to be tightening border enforcement. López Obrador said Thursday he expected a deal to be reached by the end of the day.

U.S. Customs and Border Patrol arrested the largest single group of migrants in its history last week, taking 1,036 people into custody.