In a dramatic step following days of complaining on Twitter about immigration and border security, President Trump announced Tuesday that he would be sending the military to guard segments of the U.S.-Mexico border until a wall could be built.

The big Caravan of People from Honduras, now coming across Mexico and heading to our “Weak Laws” Border, had better be stopped before it gets there. Cash cow NAFTA is in play, as is foreign aid to Honduras and the countries that allow this to happen. Congress MUST ACT NOW! — Donald J. Trump (@realDonaldTrump) April 3, 2018

According to the New York Times, Trump declared his decision in a White House meeting with Secretary of Defense Jim Mattis and visiting Baltic leaders. Trump had come to the decision after speaking with Mattis, he said. “Until we can have a wall and proper security, we’re going to be guarding our border with the military,” he said. “We really haven’t done that before, or certainly not very much before.”

According to the Washington Post, the military has been sent to the border before. In 2006, 6,000 National Guard troops were sent to assist border patrol as a stopgap measure while more border agents were trained. In the next two years, 29,000 troops were sent to assist in non–police support aspects of border control, and in 2010, President Obama sent about 1,200 troops. No active-duty military personnel could be used because there are prohibitions for using them for work similar to law enforcement. The troops did not work on the front lines, according to the Post. The way the military would be used by the Trump administration is not yet clear.

Trump had been grousing on Twitter since Sunday about immigration, seemingly kicked off by discussion on Fox News of a caravan of Central American migrants working their way toward the U.S. border.

Border Patrol Agents are not allowed to properly do their job at the Border because of ridiculous liberal (Democrat) laws like Catch & Release. Getting more dangerous. “Caravans” coming. Republicans must go to Nuclear Option to pass tough laws NOW. NO MORE DACA DEAL! — Donald J. Trump (@realDonaldTrump) April 1, 2018

The roughly 1,000 migrants—traveling in large numbers for protection—walking on foot to escape poverty and violence would take a month to reach the border, according to the Times. On Monday, Mexican officials said they were negotiating with the caravan’s leaders, according to the Times, and they said they agreed to provide the migrants with humanitarian visas in order to stay in Mexico legally. Others were given temporary passes as they work on applying for asylum and other protection. Mexico said it has already deported hundreds of participants, and, according to the Times, most migrants were from Honduras and are aiming for asylum in more northern areas of Mexico.

Notably, Trump also said he was withdrawing his support for a deal to fix the Deferred Action for Childhood Arrivals program, which, before it expired, protected hundreds of thousands of young Dreamers. And he called on Republicans to pass strict immigration laws for undocumented immigrants already living in the U.S. And finally, he threatened the North American Free Trade Agreement. “Our country is being stolen!” he warned in Sunday’s lengthy tweetstorm.

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. 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! — Donald J. Trump (@realDonaldTrump) April 1, 2018

On Monday, according to the Times, the White House announced it would actually follow up on one of the tweetstorm’s points with a plan to push a hard-line bill cracking down on immigration, making it more difficult to apply for asylum and allowing families to be detained for longer and unaccompanied children to be turned away at the border. It’s less clear whether and how Trump will follow up on his threats directed toward NAFTA. Also unclear: how he plans to pay for the proposed wall project, which has not been fully funded. Trump suggested earlier that the money come from the military’s budget, but there are rules prohibiting the Pentagon from rerouting funds in such a way without authorization from Congress.