Donald Trump has long been an opponent of trade deals that the U.S. has struck with international partners. But his opposition to one high-profile deal in particular appears to be driven as much by impulse as ideology.

For months, Trump has threatened to kill a trade deal with South Korea, just as the United States was beginning to grapple with a potential nuclear standoff with North Korea. The threats, which have struck foreign policy observers as misplaced and mistimed, are partially rooted in Trump’s long-stated belief that the deal disadvantaged American companies. But it is also owed to one meeting, shortly before the summer, where one of the president’s chief trade advisers abruptly and unexpectedly convinced Trump to target the country in lieu of tanking North America Free Trade Agreement.

According to accounts from three people with independent knowledge of the meeting, Trump was grappling with his determination to withdraw the United States from NAFTA and the realities of what would transpire from withdrawal. He had just discussed the issue over the phone with Mexican president Enrique Peña Nieto in late April, during which Nieto urged him against that course of action.

Several top administration officials at the Oval Office meeting likewise advised the administration to renegotiate but not scrap the landmark trade pact. Officials present at the meeting, which brought together top aides both sympathetic to and deeply opposed to an “America First” trade agenda, included chief economic adviser Gary Cohn, trade adviser Peter Navarro, and former White House chief strategist Steve Bannon, sources told The Daily Beast.

By the time the meeting was underway, the faction urging NAFTA renegotiation had already won out. President Trump remained determined to live up to a tough posture on trade and solicited alternative ideas. He insisted that if he were to go easy on NAFTA—which he had bashed repeatedly on the 2016 campaign trail—he needed to bring some other “America First” policy to his base.

Navarro, the director of the White House’s National Trade Council, chimed in. If Trump really wanted to withdraw from a free trade agreement, he suggested, why not refocus his rhetorical fire on the United States–Korea Free Trade Agreement, commonly known as KORUS, instead?

Sources familiar with the conversation said that Trump agreed without taking much, if any, consideration of the policy or international implications of such a move.

The White House, the Office of the United States Trade Representative, Navarro did not respond to requests for comment on this story.

But around the time of the meeting, Trump explained in an interview with The Washington Post , that withdrawing from KORUS agreement could be relatively easy. “With NAFTA, we terminate tomorrow; if we did, it ends in six months,” the president said. “With the ­Korean deal, we terminate and it’s over.”

“I was all set to terminate” NAFTA, he said in the same interview, but heeded his advisers’ caution against doing so.

Since those comments, Trump has softened his rhetoric. In the months that followed the meeting, National Security Adviser H.R. McMaster convinced the president to renegotiate the deal but not scrap it altogether. The administration no longer overtly threatens to withdraw from KORUS completely and is currently in discussions with Seoul over the details of a renegotiation—discussions that the South Korean government agreed to just last week.

Trump had mentioned KORUS on the campaign trail as a potential target in his efforts to crack down on allegedly unfair practices by major U.S. trading partners. And he had singled out Democratic rival Hillary Clinton for her role in crafting it. Clinton "unleashed a trade war against the American worker when she supported one terrible trade deal after another—from NAFTA to China to South Korea," Trump said from the stump.

The issue has also been at the top of Navarro’s agenda for some time. A University of California academic and former Democratic congressional candidate, Navarro has been one of the administration's most strident opponents of U.S. free trade deals, and KORUS is a prime target.

One source close to Navarro recounted how he has kept lengthy checklists of his top trade priorities in his office in the Eisenhower Executive Office Building. The U.S. - South Korea deal is high on Navarro’s trade to-do’s, and has been an obsession of his for years.

“We lost 100,000 jobs because of that [2012] South Korean deal,” Navarro told Breitbart, Bannon’s media flagship, in September 2016. “Our trade deficit has doubled, and, more importantly, 75 percent of the damage that has been caused by that deal has been to the auto industry itself, which, of course, is based in Michigan.”

But like a number of other White House staffers and advisers firmly in Trump’s populist-nationalist camp, Navarro has seen his internal influence diminish of late under the leadership of White House chief of staff John Kelly. Kelly has diminished Navarro’s Oval Office access, Politico reported last month. And the trade adviser has been sidelined in recent key administration trade negotiations.

Still, Trump continues to have a fondness for his protectionist trade adviser. As Politico noted in that story, the president has asked other senior officials, “Where’s my Peter? Where’s my Peter?” when he noticed Navarro’s absence.