The House of Representatives has passed a bill requiring President Donald Trump to get congressional approval before attacking Iran.

Earlier this afternoon, the Democrat-controlled House voted 220–197 in favor of a $733 billion National Defense Authorization Act (NDAA), which will fund the Pentagon and its various foreign wars through the end of the next fiscal year.

Included in the bill was a bipartisan amendment from Reps. Ro Khanna (D–Calif.) and Matt Gaetz (R–Fla.). It clarifies that Congress has passed no legislation that would allow the president to strike Iran. Their amendment says that "no Federal funds may be used for any use of military force in or against Iran" unless Congress declares war on the country or passes some other statutory authorization for an attack.

Stopping a war with Iran proved more popular than the spending bill as a whole. It earned the support of 20 House Republicans and passed with a commanding 251–170 vote.

"This is the only way to stop Trump from starting another costly war. Constitutional rights aren't optional and endless war isn't inevitable," Khanna tweeted after his amendment passed. "This is how we democratize our foreign policy and put an end to unconstitutional wars."

Tensions between the U.S. and Iran have been rising throughout the summer, with the U.S. hitting Tehran with increased sanctions and sending more troops and ships to the Persian Gulf. Iran has reportedly responded by sabotaging oil tankers and shooting down an unmanned U.S. surveillance drone.

Trump ordered air strikes on Iran in response to the loss of the drone but called the attacks off at the last minute.

Secretary of State Mike Pompeo has been pitching lawmakers on the idea that the 2001 Authorization of Military Force (AUMF)—passed in the wake of 9/11 to permit the U.S. to attack Al Qaeda—allows the U.S. to attack Iran without further congressional approval.

Khanna and Gaetz's amendment makes it clear this is not the case, stating explicitly that the 2001 AUMF does not authorize any sort of hostilities against Iran.

Having passed, the House's NDAA now goes to the Senate, which has already passed its own, larger $750 billion military spending bill.

That bill does not include any additional limitations on Trump's ability to attack Iran, nor does it seem likely that Senate Republicans will agree to fold that into the final version of the legislation.

It's a sad statement that we'd need an amendment clarifying that the Constitution gives Congress, not the president, sole power to declare war. The fact that this basic concept might be too controversial to pass is sadder still.