Senate Republicans held a late-night vote Wednesday to reject a war powers resolution concerning Iran, a reversal after President Donald Trump berated GOP senators at a Capitol meeting for opposing his stance.

The vote, which failed 47-50-1, occurred hours after a similar measure had passed the Senate. The resolution aimed to limit the president's ability to engage in military action against Iran.

Earlier in the day, Trump confronted Republican senators, calling some "losers" and one senator a "lunatic" during a private lunch. The president had been particularly incensed by a Tuesday vote where Republicans joined Democrats to pass a war powers resolution. Trump had accused senators, including Bill Cassidy of Louisiana, of opposing his war efforts. Cassidy, who had voted with Democrats on the earlier measure, later received a personal briefing on Iran from Vice President Mike Pence and envoy Steve Witkoff.

Following the briefing, Cassidy voted against the Wednesday resolution, stating he appreciated the "thorough briefing" and that his "concerns" had been addressed. Sen. Rand Paul of Kentucky, who had previously voted to halt the war, voted "present" on Wednesday, stating he wished to "give the President more space and leverage to negotiate a lasting peace."

Senate Majority Leader John Thune, R-S.D., reported that Trump was "pleased with the outcome" of the vote and later thanked Thune on social media, noting Cassidy's and Paul's changed votes. "This vote puts Iran on notice!" Trump posted.

Both war powers resolutions were largely symbolic and did not carry the full force of law. The Tuesday measure had also passed the House.

The meeting with Trump had been intended to focus on an election-year housing bill aimed at lowering costs, which had received broad bipartisan support. However, Trump reversed course, delaying his signature on the bill just before the meeting, demanding instead the passage of his proof-of-citizenship voting bill. This move frustrated some Republicans, like Sen. Thom Tillis of North Carolina, who called it "hostage" for a bill unlikely to pass.

The housing bill's delayed signing, coupled with Trump's pressure on war powers and his support for primary challengers to incumbent Republicans, has fueled concerns among some GOP lawmakers about a lack of unity heading into the midterm elections. Sen. John Cornyn of Texas noted ahead of the meeting that "We're not on the same page now, and that I think is dangerous."