WASHINGTON — The House on Friday voted for a measure that would block President Donald Trump from initiating military action against Iran without congressional approval.

Lawmakers adopted the amendment from Reps. Ro Khanna, D-Calif., and Matt Gaetz, R-Fla., in a 251-170 vote with more than two dozen Republicans in support. The measure was wrapped into the 2020 National Defense Authorization Act that the House passed Friday afternoon.

The House and the Senate will still have to reconcile their separate versions of the defense bill, and are likely to exclude the Iran amendment from the final package. Last month, a similar measure that would have restricted the president's ability to unilaterally launch military action on Iran failed in the Senate. The legislation received 50 votes in favor and 40 against, falling short of the 60-vote hurdle to advance to a final vote.

The amendment’s adoption by the House follows Trump's statement in June that the United States had been “cocked and loaded” to strike Iranian targets in retaliation for Iran shooting down an unmanned drone.

During a White House meeting a day before Trump almost greenlighted the military strike, House Speaker Nancy Pelosi, D-Calif., told the president that he would need Congress to approve any sort of military action against Iran, she later told reporters. Trump himself said that he had backed down because the Pentagon said that the loss of life would be a disproportionate response to the shooting down of the drone.

Trump said at the time, amid heightening tensions with Iran, that he had executive power to strike Iran unilaterally without congressional approval. Former President Barack Obama relied on an authorization for the use of military force from 2001 in justifying his unilateral power to launch strikes against the Islamic State militant group in Iraq and Syria.

On Friday, the House also repealed the AUMF that Congress passed in 2002 and adopted another amendment that expressed that the 2001 AUMF has served as a “blank check for any president to wage war at any time and any place.” The measure said that any new AUMF must include a sunset clause with a clear set of “objectives, targets, and geographic scope, and reporting requirements.”