Now playing
01:35
Trump warns senators: Bad to vote against border security
DALLAS, GA - OCTOBER 15: Georgia Republican House candidate Marjorie Taylor Greene endorses Sen. Kelly Loeffler (R-GA) during a press conference on October 15, 2020 in Dallas, Georgia. Greene has been the subject of some controversy recently due to her support for the right-wing conspiracy group QAnon. (Photo by Dustin Chambers/Getty Images)
DALLAS, GA - OCTOBER 15: Georgia Republican House candidate Marjorie Taylor Greene endorses Sen. Kelly Loeffler (R-GA) during a press conference on October 15, 2020 in Dallas, Georgia. Greene has been the subject of some controversy recently due to her support for the right-wing conspiracy group QAnon. (Photo by Dustin Chambers/Getty Images)
PHOTO: Dustin Chambers/Getty Images
Now playing
03:01
GOP congresswoman indicated support for executing Democrats before running for Congress
Bill Currier Oregon GOP Lah vpx
Bill Currier Oregon GOP Lah vpx
PHOTO: Oregon Republican Party
Now playing
02:49
Oregon GOP falsely claims Capitol riot was a 'false flag'
TOPSHOT - US President Joe Biden sits in the Oval Office as he signs a series of orders at the White House in Washington, DC, after being sworn in at the US Capitol on January 20, 2021. - US President Joe Biden signed a raft of executive orders to launch his administration, including a decision to rejoin the Paris climate accord. The orders were aimed at reversing decisions by his predecessor, reversing the process of leaving the World Health Organization, ending the ban on entries from mostly Muslim-majority countries, bolstering environmental protections and strengthening the fight against Covid-19. (Photo by Jim WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
TOPSHOT - US President Joe Biden sits in the Oval Office as he signs a series of orders at the White House in Washington, DC, after being sworn in at the US Capitol on January 20, 2021. - US President Joe Biden signed a raft of executive orders to launch his administration, including a decision to rejoin the Paris climate accord. The orders were aimed at reversing decisions by his predecessor, reversing the process of leaving the World Health Organization, ending the ban on entries from mostly Muslim-majority countries, bolstering environmental protections and strengthening the fight against Covid-19. (Photo by Jim WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
PHOTO: JIM WATSON/AFP/AFP/Getty Images
Now playing
03:40
Weir: Biden promised to help avoid fossil-fuel suicide
US Senate Minority Leader Mitch McConnell (L), R-KY, speaks with US Senator John Barrasso (R), R-WY, after the Republican Policy Luncheon on Capitol Hill in Washington, DC, on January 26, 2021. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
US Senate Minority Leader Mitch McConnell (L), R-KY, speaks with US Senator John Barrasso (R), R-WY, after the Republican Policy Luncheon on Capitol Hill in Washington, DC, on January 26, 2021. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
PHOTO: JIM WATSON/AFP/AFP via Getty Images
Now playing
03:12
CNN breaks down McConnell's telling vote on impeachment trial
duckworth paul
duckworth paul
PHOTO: CNN
Now playing
01:19
Tammy Duckworth to Rand Paul: Stop covering for Trump
PHOTO: senate tv
Now playing
03:53
Watch senators sworn in for Trump's second impeachment trial
Now playing
04:32
'Haven't ruled anybody out': Dominion lawyer on possible lawsuits
WASHINGTON, DC - JANUARY 06: President Donald Trump arrives at the "Stop The Steal" Rally on January 06, 2021 in Washington, DC. Trump supporters gathered in the nation
WASHINGTON, DC - JANUARY 06: President Donald Trump arrives at the "Stop The Steal" Rally on January 06, 2021 in Washington, DC. Trump supporters gathered in the nation's capital today to protest the ratification of President-elect Joe Biden's Electoral College victory over President Trump in the 2020 election. (Photo by Tasos Katopodis/Getty Images)
PHOTO: Tasos Katopodis/Getty Images North America/Getty Images
Now playing
03:00
Haberman reveals list of Republicans Trump wants to 'punish'
Now playing
03:02
Avlon: Republicans offended by Biden's call for unity
PHOTO: Getty Image/CNN
Now playing
02:10
'Really?': Lemon reacts to Haley's take on Trump's trial
WASHINGTON, DC - NOVEMBER 19: Rudy Giuliani holds up a mail-in ballot as he speaks to the press about various lawsuits related to the 2020 election,  inside the Republican National Committee headquarters on November 19, 2020 in Washington, DC. President Donald Trump, who has not been seen publicly in several days, continues to push baseless claims about election fraud and dispute the results of the 2020 United States presidential election. (Photo by Drew Angerer/Getty Images)
WASHINGTON, DC - NOVEMBER 19: Rudy Giuliani holds up a mail-in ballot as he speaks to the press about various lawsuits related to the 2020 election, inside the Republican National Committee headquarters on November 19, 2020 in Washington, DC. President Donald Trump, who has not been seen publicly in several days, continues to push baseless claims about election fraud and dispute the results of the 2020 United States presidential election. (Photo by Drew Angerer/Getty Images)
PHOTO: Drew Angerer/Getty Images North America/Getty Images
Now playing
02:30
Dominion contemplates next legal move after Giuliani lawsuit
US President Joe Biden delivers remarks before signing an Executive Order in the South Court Auditorium at the White House on January 25, 2021 in Washington, DC. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
US President Joe Biden delivers remarks before signing an Executive Order in the South Court Auditorium at the White House on January 25, 2021 in Washington, DC. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
PHOTO: Jim Watson/AFP/Getty Images
Now playing
02:50
Biden thinks US can get to 1.5 million vaccine doses daily
TAMPA, FL - AUGUST 29:  U.S. Sen. Rob Portman (R-OH) waves during the third day of the Republican National Convention at the Tampa Bay Times Forum on August 29, 2012 in Tampa, Florida. Former Massachusetts Gov. Former Massachusetts Gov. Mitt Romney was nominated as the Republican presidential candidate during the RNC, which is scheduled to conclude August 30.  (Photo by Mark Wilson/Getty Images)
TAMPA, FL - AUGUST 29: U.S. Sen. Rob Portman (R-OH) waves during the third day of the Republican National Convention at the Tampa Bay Times Forum on August 29, 2012 in Tampa, Florida. Former Massachusetts Gov. Former Massachusetts Gov. Mitt Romney was nominated as the Republican presidential candidate during the RNC, which is scheduled to conclude August 30. (Photo by Mark Wilson/Getty Images)
PHOTO: Mark Wilson/Getty Images
Now playing
02:16
GOP senator explains why he won't seek reelection
diegal
diegal
PHOTO: CNN
Now playing
02:58
Former Republican: We've got a bankrupt party
(CNN) —  

The three Republican senators outside the White House gate weren’t on the list.

Hoping to stave off an embarrassing rebuke of President Donald Trump, Sens. Lindsey Graham of South Carolina, Ted Cruz of Texas and Ben Sasse of Nebraska decided to show up virtually unannounced to make a last-ditch effort Wednesday night to strike a bargain that would avoid an embarrassing defeat in the Senate over Trump’s national emergency declaration.

But their surprise overture failed, and the following afternoon the Senate passed the resolution with 12 Republicans joining Democrats, setting Trump up for the first veto of his presidency.

The night before, the trio of GOP senators were initially stalled at the entrance, their names not precleared to enter the secure complex. By the time they made it inside, Trump was enraged at their antics, which fell in the middle of a family dinner.

“We just kind of barged in on his supper,” Graham admitted to reporters a day later, as lawmakers were preparing to vote on a measure annulling the national emergency declaration Trump signed last month to secure border wall funding.

The White House is now reeling from a setback following the Senate passing the resolution, despite the pressure campaign it had waged for the last week. That a dozen GOP senators would buck the President was an outcome a group of Republican senators had been hoping to prevent as they crafted a compromise that would allow the national emergency to proceed while limiting a president’s powers to declare one in the future.

Trump rejected such a measure midday Wednesday in a phone call with Senate Republicans during their weekly lunch. But believing he could still be convinced, Graham, Cruz and Sasse piled into a car to appeal to him in person.

The trio had made an unsuccessful attempt earlier in the afternoon to sit down with Trump, but White House aides said it was too late and didn’t see the point in bringing them over. Trump had already told staff he was resigned to issuing his first veto after it became clear that enough Republicans would support the measure to overturn the declaration for it to pass.

Undeterred, the lawmakers went anyway. Graham phoned Trump while he was in the car on Pennsylvania Avenue to inform him that he and the other two Republican senators were en route.

Graham said the group “barged” into dinner and made clear that if the President would support a proposal from Republican Sen. Mike Lee of Utah to limit the length of national emergency declarations, that would minimize Republican defections “dramatically.”

The lawmakers had found themselves in a tough position: Break with the President or vote against something they agree with. They wanted some kind of agreement that if they voted against the measure Thursday, then Trump wouldn’t utilize his executive power like this again.

But instead of a change of heart, their entreaties were met with anger. Trump yelled at the group for interrupting him, according to people familiar with the matter.

The meeting went downhill fast, other sources said, as Trump grew frustrated at attempts to limit his ability to declare national emergencies in the future. A White House lawyer was brought in to point out problems with the idea and explain why it wouldn’t work for the White House, a source said.

When the three senators sat down with Trump, it became clear they weren’t presenting a single proposal – Graham was there to discuss Lee’s proposal, while Cruz pitched a separate idea to pull back the military construction funding portion of the emergency declaration. It was something, after consulting with the White House lawyer in attendance, the President rejected out of hand.

The overall meeting, the source said, was “just unproductive.”

Graham, the President’s closest ally in the Senate, struck a more optimistic note on Thursday. He told reporters the President had listened intently during their meeting.

“I said I don’t expect you to give up any powers of the president that you think is necessary but if you could find a way to sit down and bridge the gap here prospectively it would be in everybody’s best interest,” Graham said.

“We’ll see what happens,” Graham added. “It may bear fruit.”

And he may be at least partially right. Though Trump made clear both during his interrupted dinner and in the earlier phone conversation with senators that he would not support a proposal to limit future national emergency declarations to 30 days, he seemed to reverse course on Twitter Thursday.

“Prominent legal scholars agree that our actions to address the National Emergency at the Southern Border and to protect the American people are both CONSTITUTIONAL and EXPRESSLY authorized by Congress,” Trump wrote. “….If, at a later date, Congress wants to update the law, I will support those efforts, but today’s issue is BORDER SECURITY and Crime!!! Don’t vote with Pelosi!”

Senate Republicans were caught off guard by Trump’s tweet that he would support changes to limit his future authority on national emergencies, according to multiple Senate aides, but it did not appear to have a significant effect on the final vote count.

“Too little, too late,” one senior GOP aide said. It might have swayed a few on-the-fence senators, but the resolution still passed with a dozen GOP defections.

Shortly after the President’s tweet, Utah Sen. Mitt Romney announced he would support the resolution to terminate the national emergency, which kicked off a steady stream of GOP defections throughout the day.

The margin was still slightly better than some aides had feared. Trump had hoped the number of “yes” votes would stay below 60, aides say, a symbolic limit that he believes would save some embarrassment, though still require him to use his veto pen. There were 59.

In internal conversations, Trump had characterized the vote as a loyalty test, even though some of those who voted for it, including Lee and Republican Sen. Rand Paul of Kentucky, have proved to be allies on other issues in the past. Even as members of his staff were focused Wednesday on managing the Boeing plane crisis, Trump himself remained preoccupied with the looming vote, according to people who spoke with him.

He fired off tweets. He made direct appeals to lawmakers over the phone. And senators who attended a Wednesday meeting on trade also heard a bid from Trump on the national emergency, though at that stage he had already conceded the resolution would likely pass.

This story has been updated to include additional developments Thursday.

CNN’s Kevin Liptak, Sunlen Serfaty and Lauren Fox contributed to this report.