The House gave final approval on Wednesday to a bipartisan resolution aimed at forcing President Trump to get explicit approval from Congress before taking further military action against Iran, in a bid by lawmakers to reassert congressional war powers that is all but certain to be thwarted by a presidential veto.

The vote, 227 to 186, amounted to a rare move by Congress to claw back its authority over matters of war and peace from a president who has a penchant for unilateral action and little patience for consulting with lawmakers. It lands a jab at Mr. Trump as he attempts to confront the growing outbreak of coronavirus, more than two months after he moved without congressional authorization to kill Iran’s most important commander.

Mr. Trump has threatened to veto the legislation, arguing that it is unnecessary because the United States is not currently engaged in any use of force in Iran, and that it would send “a very bad signal” of weakness to Iran. The Senate passed the measure last month in a bipartisan vote, but neither that resolution nor the one that was approved on Wednesday drew the two-thirds majority support needed to override a veto.

Still, lawmakers argued on Wednesday that action to curtail the president’s war-making authority was not only necessary, but urgent to stop the erosion of Congress’s wars powers.