US President Donald Trump's ability to wage war on Iran without congressional approval has been limited in a Senate bill passed by his fellow Republicans.
The Iran war powers resolution was approved by a vote of 55-45 - hours after Mr Trump warned that it would make America less safe from Iran.
The House passed a version of the bill in January, after Mr Trump ordered the killing of a top Iranian general.
Mr Trump is expected to veto the bill once it reaches the White House.
On Thursday eight Republicans bucked the president's party, which has a majority in the Senate, to vote in favour of forcing Mr Trump to consult with Congress before conducting military operations against Iran.
A day before the vote, Mr Trump tweeted: "It is very important for our Country's SECURITY that the United States Senate not vote for the Iran War Powers Resolution."
"We are doing very well with Iran and this is not the time to show weakness... If my hands were tied, Iran would have a field day. Sends a very bad signal. The Democrats are only doing this as an attempt to embarrass the Republican Party."
What does the resolution require?
The resolution requires Mr Trump to remove troops who are engaged in hostilities with Iran unless Congress declares war or passes a resolution allowing the specific use of force.
It adds that no part of the resolution "shall be construed to prevent the United States from defending itself from imminent attack".