Senate Majority Leader Mitch McConnell and other top Republicans have said for weeks they were against Donald Trump declaring a national emergency to build his border wall.

Though in the end, the Kentucky Republican ended up backing the president while raging Democrats move to block the motion in a legal fight that could last years.

Trump signed the declaration Friday morning.

Trump plans to shift about $7 billion in federal funds, in addition to the $1.375 billion contained in the spending bill that keeps the government open, to construct his long-promised border wall between the U.S. and Mexico.

McConnell’s decision to support the president reportedly came as a surprise to many of his colleagues as members of Congress worry they’re giving too much power to the president, particularly when it comes to appropriating funds — which is by law the job of Congress, not the president.

Article I of the Constitution reads: “No money shall be drawn from the Treasury, but in consequence of appropriations made by law.”

Hence the fight over border wall funds appropriation.

“It’s a bad idea,” Florida Senator Marco Rubio said. “It raises real constitutional questions.”

Rand Paul, R-Ky., also said he did not approve of either the declaration or the spending bill.

“I’m disappointed with both the massive, bloated secretive bill that just passed and with the president’s intention to declare a national emergency to build a wall,” Paul tweeted. “I, too, want stronger border security, including a wall in some areas. But how we do things matters. Over 1,000 pages dropped in the middle of the night and extraconstitutional executive actions are wrong, no matter which party does them.”

Some GOP senators moved to back the president.

“I stand firmly behind President Trump’s decision to use executive powers to build the wall-barriers we desperately need,” Lindsey Graham, R-S.C., tweeted.

Others, such as Mitt Romney, R-Utah, and Roy Blunt, R-Mo., said they will wait and see what the president does before making a decision.

On the left, members of Congress already are preparing bills to block the national emergency declaration. Some Republicans, Rubio included, have said they might side with the Democrats.

If a majority in both chambers votes the declaration down, Trump could veto the resolution. Then Congress could vote to override the veto with a two-thirds majority in each chamber. With McConnell backing the president, the chances of a veto override are slim in the Senate.

Rep. Alexandria Ocasio-Cortez, D-N.Y., seeking more headlines, said she will introduce a bill, along with Joaquin Castro, D-Texas, to stop the declaration.

“If President Trump declares a national emergency to fund his border wall, I’m prepared to introduce a resolution to terminate the President’s emergency declaration,” Castro said Thursday.

“@JoaquinCastrotx and I aren’t going to let the President declare a fake national emergency without a fight,” Ocasio-Cortez tweeted Friday.

House Speaker Nancy Pelosi, D-Calif., also told reporters a legal challenge is on the table.

“The president is doing an end run around Congress, the power of the purse,” she said Thursday at a news conference.

Pelosi and Senate Minority Leader Chuck Schumer, D-N.Y., said they “will defend our constitutional authorities in Congress, in the courts and in the public, using every remedy available.”

“The President’s emergency declaration, if unchecked, would fundamentally alter the balance of powers, inconsistent with our founders’ vision. … The president is not above the law. The Congress cannot let the president shred the constitution,” they said.

Legal specialists say a national emergency declaration sets bad precedent.

“If Trump can get away with declaring a national emergency and then spending money on this construction project, which is only vaguely related to national security, why wouldn’t future presidents do the same thing?” George Mason law professor and constitutional law expert Ilya Somin said in an interview with Bloomberg. “What’s to stop a President Elizabeth Warren or any other Democratic president from saying climate change is a threat to national security?”

University of Baltimore law professor Charles Tiefer said the Democratic-controlled House has standing to sue the White House for attempting to subvert the authority of Congress. He also said the declaration could move lawmakers to change the language on the books, forbidding future spending transfers under national emergency declarations.

“What you would see is bill after bill coming out of Congress specifying that funds in those bills cannot be used for a wall,” he told Bloomberg.

For his part, Trump said he expects to be sued, and he thinks “we will be very successful in court” in a case that is likely to end up before the Supreme Court.

The only thing certain about the border wall fight is that the fight is just beginning.