The deal was reached after a call between the US president and his Mexican counterpart, Claudia Sheinbaum.