Federal law could not be more clear that President Donald Trump can declare a national emergency at the U.S.-Mexican border, and that such a declaration gives him access to all the funding he needs to build the wall.

Congressional Democrats have rejected all compromise legislation that would have given them half a loaf, ironically putting the president in a situation where the only way he can keep his most-often-repeated campaign promise is to declare a border emergency, where he does not need to compromise with Democrats on anything.

The National Emergencies Act of 1976 gives every president unconditional authority to declare an emergency on any subject, including a border emergency. Codified at 50 U.S.C. § 1601, this federal statute provides that “the words ‘any national emergency in effect’ means a general declaration of emergency made by the President.”

Contrary to the hyperventilating from partisan Democrats and media pundits pretending to be legal experts, these emergencies are common, and can last decades. Presidents have declared 58 emergencies since 1979, and 31 of those 58 are still in effect today. The first such emergency, which President Jimmy Carter declared in 1979 against Iran-sponsored terrorism, is still in effect 40 years later.

Congress has passed 136 statutory provisions pertaining to presidential emergency powers over the years, delegating significant authority to the president when he declares an emergency. Congress’s research arm notes that in certain types of emergencies, these powers include restricting travel, seizing commodities or property, and regulating businesses.

Not only that, but Congress specifically amended the Posse Comitatus Act – the law that prevents U.S. military troops from operating on U.S. soil, found at 18 U.S.C. § 1385 – in the 2007 National Defense Authorization Act to allow U.S. troops to function domestically under certain circumstances. One of those circumstances is to enforce federal law. Another is that the defense secretary can deploy troops to stop illegal aliens from crossing the U.S. border if the U.S. Department of Homeland Security (DHS) requests military assistance.

Once President Trump declares an emergency, under 33 U.S.C. § 2293(a) the secretary of defense:

without regard to any other provision of law, may … apply the resources of the Department of the Army’s civil works program, including funds, personnel, and equipment, to construct or assist in the construction, operation, maintenance, and repair of authorized civil works, military construction, and civil defense projects that are essential to the national defense.

The next subsection of that law adds that this authority continues until the president declares the emergency has ended, plus an additional 180 days.

Congress passed the Secure Fence Act in 2006, which explicitly authorizes building physical barriers on the U.S.-Mexican border. But even if Congress had not passed that law, the separate law quoted above gives President Trump all the authority he needs to act without further approval from Capitol Hill.

Once President Trump declares an emergency on the border, he can direct Acting Defense Secretary Patrick Shanahan to order the Army Corps of Engineers to begin constructing the wall. Congress has already appropriated $13.9 billion in emergency funds that the Corps can use, much more funding than the president’s $5.7 billion plan calls for.

Additionally, if DHS requests military support, the Pentagon can then also send however many additional troops the president needs to protect the workers and secure the border during construction.

Lawsuits are likely, but it is possible that only Congress itself has standing to sue. The only other injury that any other plaintiff could claim is that they have a legal right to illegally enter the United States. Even the most liberal judicial activist might look askance at such a lawsuit.

It is plausible that property owners along the border could sue, if any of those owners object to the U.S. government’s securing their backyard. The nature of their suit would likely be that the government must exercise eminent domain to seize the narrow strip of their property on which the wall actually rests, and that Congress must do so through legislation.

Such challenges should ultimately fail, because courts should construe the Secure Fence Act as authorizing the seizure of sufficient land to build the barriers authorized in that statute. Under the Constitution’s Takings Clause, the government may seize whatever land it wishes, so long as the land is for “public use” and the government then pays the owner “just compensation,” which means fair market value. It is also possible that the courts could rule that an owner’s property rights on the national border is implicitly limited to the extent necessary to defend that border, because maintaining a border is the sovereign prerogative of any national government.

But a challenge by Congress is possible. Under the Supreme Court’s 1997 decision in Raines v. Byrd, the Democrat-controlled House could pass a majority resolution authorizing Speaker Nancy Pelosi to file suit in the name of the U.S. House, arguing that the president’s actions violate the separation of powers.

Such a lawsuit would be a loser, however. None of this wall-construction project requires any inherent authority the president has as commander-in-chief under Article II, Section 2 of the U.S. Constitution. Instead all the powers President Trump would be asserting is authority explicitly granted by Congress in statute, using funds that Congress has already authorized and appropriated.

Lawsuits brought in any of the district courts within the U.S. Courts of Appeals for the Ninth Circuit or D.C. Circuits might succeed before liberal trial judges or liberal appeals panels, but President Trump should ultimately win before the U.S. Supreme Court, because his actions are authorized both by federal statute and the Constitution.

In the end, President Trump should therefore prevail in any legal challenge, the wall will be built, and the border secured. Then the American people will have an opportunity in 2020 to pass judgment on whether the Democrats are correct that the wall achieved nothing, or if President Trump is correct that the wall drastically reduces illegal crossings, drug smuggling, and human trafficking, making America safer.

Ken Klukowski is senior legal editor for Breitbart News. Follow him on Twitter @kenklukowski.