WASHINGTON — Congress has failed in its bid to block President Donald Trump from engaging in further military action against Iran without first seeking approval from the legislative branch. 

The Senate fell short on Thursday of the votes needed to override Trump’s veto of a bipartisan resolution that asserted congressional authority on use of military force. Trump rejected the measure Wednesday, calling it “insulting” and an attempt to divide the Republican party ahead of the presidential election.

The override attempt was defeated with 49 senators voting in favor of the override and 44 opposed. The measure needed two-thirds support to be approved.

The resolution’s chief sponsor, Democratic Sen. Tim Kaine of Virginia, said the war powers measure was not about Trump or even the presidency, but instead was an important reassertion of congressional power to declare war.

“A bipartisan majority of both houses (of Congress) stood up and made clear that unless there is a carefully reached consensus in Congress that war is necessary, we should not send our troops into harm’s way,’’ Kaine said after the vote. “I’m hopeful that despite President Trump’s veto, the bipartisan support for this resolution will restrain his future behavior when the lives of our men and women in uniform are at stake.”

The resolution was approved after members of Congress from both parties expressed concern following a U.S.-launched airstrike that killed a top Iranian general in Iraq in January. Lawmakers said they feared that Iran and the U.S. were perilously close to all-out conflict and moved to restrain further actions Trump might take against Iran. 

The Constitution gives Congress the power to declare war. Even so, Trump said the resolution implied that his own constitutional authority to use military force was limited to defending the United States and its forces against imminent attack. 

“That is incorrect,” Trump said in a statement. “We live in a hostile world of evolving threats and the Constitution recognizes that the president must be able to anticipate our adversaries’ next moves and take swift and decisive action in response. That’s what I did!”

Kaine said Trump’s comments misconstrued the Constitution and mis-read the intentions of Congress in approving the resolution.

“It’s not insulting. It’s our job,” he said of the war-powers measure. “It was introduced to stop an unnecessary war.” 

The resolution, approved by the Republican-controlled Senate and Democratic-controlled House, came in the wake of rising conflict between the U.S. and Iran.

Tensions rose after the Trump administration withdrew from a nuclear deal with Iran led by the Obama administration and reimposed crippling sanctions against Tehran. Last year, the U.S. sent thousands more troops, including long-range bombers and an aircraft carrier, to the Middle East in response to what it called a growing threat of Iranian attacks on U.S. interests in the region.

The tensions also spiked when U.S. forces killed Iran’s most powerful general in early January. Iran responded with a ballistic missile attack on a base in western Iraq where U.S. troops were present. No Americans were killed, but more than 100 suffered traumatic brain injuries from the blasts.

Trump did not consult with congressional leaders ahead of the attack on Gen. Qassem Soleimani, and there was widespread concern in Congress that Tehran and Washington were perilously close to all-out conflict. 

The White House sent Congress a notification explaining the rationale for killing Soleimani, but kept it classified. Some Democrats were unconvinced that the threat posed by Soleimani was imminent or that other alternatives to the killing were pursued in good faith. After Trump administration officials briefed lawmakers, House Speaker Nancy Pelosi announced a vote on the resolution, calling the killing of Soleimani “provocative and disproportionate.” 

The war-powers vote marked a rare exertion of authority from Congress, which also moved to impose restrictions on U.S. involvement with the Saudi-led war in Yemen last year after U.S.-based journalist Jamal Khashoggi was killed in a gruesome murder at Saudi Arabia’s consulate in Turkey. Trump promptly vetoed that measure as well.

On Iran, Trump said the resolution was based on misunderstandings of facts and the law. He said the strike on Soleimani was authorized by law, including a 2002 congressional vote authorizing use of force against Iraq and Article II of the Constitution, which outlines presidential powers.