The Senate passed a resolution to end the state of emergency at the southern border Thursday amid an already contentious political fight on immigration.

President Donald Trump made the emergency declaration on February 15 amid budget talks failing to meet his requests for border wall funding. He reluctantly signed a compromise deal at the same time to avoid a second partial government shutdown as a result of the dispute.

The Senate passed the resolution to block the emergency declaration on a 59 to 41 vote.

The resolution now goes to the president — where he’s likely to veto it. The House already passed the proposal mostly along party lines on February 26. The resolution blocks the president from diverting emergency funds for the construction of the border wall.

Trump has called for $5.7 billion to fund the project.

“What we are doing here today is no one’s first choice but it’s useful to recall how we find ourselves at this point today,” Sen. John Cornyn (R-Texas) said from the floor before the vote. “My preference would be for the normal appropriations process to be used. But when your negotiating partners refuse to take a seat at the table, ‘normal’ goes out the window. Our colleagues across the aisle left the president with few options to fund what he believed were so important for the nation’s security, and that’s what led us to this situation.”

Related: House Dems Pass Resolution to Block Trump’s Border Emergency

Cornyn argued the refusal of congressional Democrats to engage in negotiations on border security funding also led to the government shutdown. He added that the resistance to the wall came despite a clear message from border security experts and clear signs the situation on the southern border is a humanitarian crisis.

“So what the president did is he asked his lawyers to look at what other authority under congressionally passed laws signed by previous presidents might I have to access additional funds,” Cornyn said. “His lawyers pointed to the 1976 National Emergencies Act which have granted presidents since that time broad powers to reprogram funding previously appropriated by Congress. So this idea that somehow this is an unconstitutional act by this president is simply wrong.”

Senate Republicans have a majority — but there were enough defectors to help the measure pass with a total of 12 voting for it. Democrats only needed four lawmakers to cross party lines, since they already overwhelmingly supported the resolution at 47 members. Sen. Rand Paul (R-Ky.) became the fourth Republican senator to express his support for the resolutionon  March 4.

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

Senate Majority Leader Mitch McConnell (R-Ky.) had said in response that he expected the resolution to pass the Senate. He also said earlier he would not handicap the resolution when it came to his side but did express his opposition to it on February 26. The Republican leadership generally has been opposed to the proposal.

Trump made the emergency declaration in order to free up billions of dollars in emergency funds for the border wall from various federal reserves through the National Emergencies Act (NEA). He has repeatedly argued the situation at the border is a crisis and that a wall is critical to deterring illegal drugs and criminal gangs from coming into this country.

“This is not a normal vote,” Senate Minority Leader Chuck Schumer (D-N.Y.) said before the vote. “It’s not a normal day, what we’re doing here today. It’s not your typical vote on an appropriations or authorization bill. It doesn’t concern a nomination or an appointment. This will be a vote about the very nature of our constitution, our separation of powers, and how this government functions henceforth.”

The border security fight led to a record-long partial government shutdown and threatened another. But the first shutdown was eventually ended with a short-term spending bill on January 25. That spending bill only gave congressional negotiators three weeks to find a compromise.

The eventual deal only included $1.375 billion for physical barriers.

Related: Dems Introduce Resolution to Block Trump’s Emergency Declaration

“The framers gave Congress the power of the purse in Article 1 of the Constitution,” Schumer said. “It’s probably our greatest power. Now the president is claiming that power for himself under the guise of an emergency declaration to get around a Congress that repeatedly would not authorize his demand for a border wall. The president has not justified the emergency declaration.”

Rep. Joaquin Castro (D-Texas) introduced the resolution soon after the president made the declaration. Speaker of the House Nancy Pelosi (D-Calif.) helped to build support for the plan in the week leading up to its introduction.

She sent a letter to lawmakers and held press conferences to encourage them to support plan.

Trump had been making his opposition to the resolution clear in the days leading up to the vote.

He told senators to use their “discretion” on Wednesday — but also warned them against blocking his emergency declaration. He argued the vote is not about the constitutionality of the move because it is constitutional, but rather it’s a vote that comes down to border security.

The American Civil Liberties Union (ACLU) became one of the first major organizations to announce a lawsuit soon after the president made his declaration. The group argued that the decision evades congressional funding restrictions in an unprecedented violation of the law. The ACLU also sent a letter to lawmakers urging them to vote for the resolution.

“We thank every senator who voted to defend the Constitution and Congress’s own role in our systems of checks and balances” ACLU deputy director Christopher Anders told LifeZette. “President Trump should sign the resolution when it gets to his desk.”

Trump is also facing other lawsuits over his emergency declaration.

California Attorney General Xavier Becerra is leading over a dozen other states who have sued the administration. There were also many former national security officials who signed onto a statement that publicly rebuked the emergency declaration.

Check out this video: