President Donald Trump has threatened to walk away from the North American Free Trade Agreement if Mexico does not change its immigration policy.

Trump also cited the Deferred Action for Childhood Arrivals program as a necessary emphasis.

Trump's tying of the trade agreement to immigration and DACA throws a wrench in already fraught negotiations.

President Donald Trump added another layer to the already tricky negotiations over the North American Free Trade Agreement over the past two days by tying the talks to immigration policy, raising fears that the trade deal could be in jeopardy.

"Mexico is doing very little, if not NOTHING, at stopping people from flowing into Mexico through their Southern Border, and then into the U.S.," Trump tweeted Sunday. "They laugh at our dumb immigration laws. They must stop the big drug and people flows, or I will stop their cash cow, NAFTA. NEED WALL!"

Trump followed up that threat on both Monday and Tuesday, repeatedly attacking Mexico's ability to "stop people from coming through their country and into ours" and calling for Congress to make changes to US immigration policy including the Deferred Action for Childhood Arrivals program.

"Cash cow NAFTA is in play, as is foreign aid to Honduras and the countries that allow this to happen," Trump said Tuesday. "Congress MUST ACT NOW!"

This isn't the first time Trump has threatened to pull the US out of NAFTA, which he called "the worst trade deal in history" during the 2016 campaign. But the threats come at a fraught moment for talks over a new version of the deal.

Throwing another problem on the pile

The negations among the three members of NAFTA — the US, Canada, and Mexico — are already facing problems. Arguments over the treatment of many goods have led to hiccups in the eight months of negations.

Negotiators have so far come to agreement on just six of the deal's 30 chapters, which are large sections of the agreement dealing with different types of goods. While US Trade Representative Robert Lighthizer sounded encouraged after the most recent round of talks in March, the other countries were less enthusiastic.

Given the large number of issues left to sort out, Trump's decision to tie the deal to unrelated changes to immigration policies represents another headache for negotiators.

Trump with Canadian Prime Minister Justin Trudeau. Chip Somodevilla/Getty Images Greg Valliere, the chief global strategist at Horizon Investments, said Trump's tweets were particularly worrying because Trump appeared to need a domestic-policy win to ensure the US remains in the trade deal.

"Trump's Easter rant about the Dreamers, apparently in response to a Fox TV piece that morning, was riddled with factual inaccuracies about the DACA program — but the bigger message is that he's willing to scrap NAFTA unless he gets an immigration deal — including a wall — from Congress," Valliere said.

Trump moved in September to end the DACA program. In contrast to Trump's latest tweets, which also suggested the program was encouraging young immigrants to enter the US illegally, it applies only to a specific class of immigrants, sometimes called Dreamers, who entered the US as minors prior to July 2012. Additionally, the DACA negotiations are stuck in a deadlock in large part because of Trump's unwillingness to make a reach a deal with Democrats.

Chris Krueger, an analyst at Cowen Washington Research Group, said the tweets were just another sign Trump could pull the US out of the deal on a whim, particularly given the turnover of his economic advisory staff.

"Concerns about potential NAFTA abrogation in the spring and summer months should not be mistaken given that this is all up to the whim of an increasingly erratic chief executive who has carte blanche from a non-existent board of directors," Krueger wrote Monday.

Kreuger said the developments could also weigh on the patience of Mexican and Canadian officials, who have already threatened to walk away from the deal.

Time is ticking down

While NAFTA talks have been ongoing since August, the added immigration concern comes just as negotiations are hitting a critical stretch in April.

Since the deal is being renegotiated under Trade Promotion Authority, there are a series of steps that would delay any vote on a new deal in Congress by 195 days.

That has created an artificial deadline of May 1 for any deal to get approved this year. After that Congress would have to either take a vote in a lame-duck session after the 2018 midterms or delay the matter indefinitely.