MEXICO CITY — Mexico’s president came to office promising a fresh approach to combat record-high homicide rates: a new National Guard made up of soldiers and police officers.

Now, in a deal to assuage his American counterpart and avert a trade war, Andrés Manuel López Obrador will have to deploy some of that force to patrol borders instead.

Under an agreement hammered out in marathon negotiations with American officials over the last few days, Mexico agreed to send up to 6,000 National Guard troops to its southern border with Guatemala. It also agreed to allow more asylum applicants to wait in Mexico while their cases are pending in the United States.

The timing and many other details about these steps remain uncertain. But officials in both countries say all this is meant to take place quickly — an indication that, at least for now, Mr. López Obrador chose to prioritize appeasing President Trump over domestic priorities like combating violent crime.