US President Trump said Sunday he is placing emergency tariffs, a travel ban, enhanced customs and border protection inspections and other measures on Colombia after the country’s government rejected two repatriation flights from the U.S. carrying migrants. Few hours later, Colombia walked back from the brink of a damaging trade war with the United States, reaching an agreement.

The feud began early Sunday over the US repatriation flights carrying deportees to Colombia.

Trump responded by ordering 25% emergency tariffs on all goods coming into the United States, which would be raised to 50% in a week, a travel ban and visa revocations on Colombian government officials as well as its allies and supporters.

He also ordered visa sanctions on all party members, family members, and supporters of the Colombian government, enhanced customs and border protection inspections of all Colombian nationals and cargo on national security grounds and IEEPA Treasury, banking and financial sanctions.

Trump campaigned heavily in the last election on the issue of immigration, and members of his new administration have looked to intensely promote any action on the matter within the president’s first few days in office.

However, it is the first time Trump took major action against another country over his immigration policy since he took office last week.

“I was just informed that two repatriation flights from the United States, with a large number of Illegal Criminals, were not allowed to land in Colombia. This order was given by Colombia’s Socialist President Gustavo Petro, who is already very unpopular amongst his people,” Trump said in a post on Truth Social.

Trump added that the Colombian president’s “denial of these flights has jeopardized the National Security and Public Safety of the United States,” and therefore he had directed his administration to immediately take urgent and decisive retaliatory measures.

“These measures are just the beginning,” Trump wrote. “We will not allow the Colombian government to violate its legal obligations with regard to the acceptance and return of the criminals they forced into the United States.”

In response, Colombian President Gustavo Petro threatened retaliatory tariffs on the US in response to Trump’s tariffs and sanctions.

By Sunday evening, the White House announced the two countries had reached their agreement.

The White House said Colombia had agreed to accept migrants arriving on U.S. military aircraft “without limitation or delay” and so the tariff orders will be “held in reserve, and not signed, unless Colombia fails to honor this agreement.”

The late-night declaration of victory by the White House caps a tumultuous day of threats lobbed back and forth between the countries’ two leaders on social media.

Press secretary Karoline Leavitt said in the statement: “The Government of Colombia has agreed to all of President Trump’s terms, including the unrestricted acceptance of all illegal aliens from Colombia returned from the United States, including on U.S. military aircraft, without limitation or delay.

“Based on this agreement, the fully drafted IEEPA tariffs and sanctions will be held in reserve, and not signed, unless Colombia fails to honor this agreement. The visa sanctions issued by the State Department, and enhanced inspections from Customs and Border Protection, will remain in effect until the first planeload of Colombian deportees is successfully returned.”

The Colombian foreign ministry said in a statement: “We have overcome the impasse with the United States government.

“We will continue to receive Colombians who return as deportees, guaranteeing them decent conditions as citizens subject to rights.”