Updated 9:14 p.m. | President Donald Trump said Tuesday he would use the military to secure the U.S.-Mexico border, a complicated plan that could require him to declare a national emergency to avoid running afoul of a federal law that prohibits the military from acting as a police force.

“Until we can have a wall and proper security, we’re going to be guarding our border with the military. That’s a big step,” Trump told reporters during a White House appearance with leaders of Baltic countries.

Trump said he would be meeting with Defense Secretary James Mattis about the idea. Hours after his remarks, the White House said Trump was briefed on mobilizing the National Guard as well as other efforts to tighten border security.

In addition, the White House said Trump and senior officials including Mattis, Homeland Security Secretary Kirstjen Nielsen, Joint Chiefs of Staff Chairman Joseph F. Dunford Jr. and Attorney General Jeff Sessions “agreed on the need to pressure Congress to urgently pass legislation to close legal loopholes exploited by criminal trafficking, narco-terrorist and smuggling organizations.”

While neither the president nor the White House provided details on how such a plan would be executed, the idea encompasses several layers.