WASHINGTON — The Senate voted on Thursday to require that President Trump seek congressional authorization before taking further military action against Iran, as Democrats joined forces with eight Republicans to try to rein in the president’s war-making powers weeks after he escalated hostilities with Tehran.

The bipartisan vote, 55 to 45, amounted to a rare attempt by the Senate to restrain Mr. Trump’s authority just over a week after it voted to acquit him of impeachment charges, and nearly six weeks after the president moved without authorization from Congress to kill a top Iranian security commander.

But it was a mostly symbolic rebuke of the president, as support for the measure fell short of the two-thirds supermajority needed to override a promised veto by Mr. Trump. The House passed a similar measure last month on a nearly party-line vote that also fell well short of that margin.

Still, indignant at the administration’s handling of a drone strike in Iraq last month that killed a top Iranian official — a major provocation that pushed the United States and Iran to the brink of war — an unusually large number of Senate Republicans crossed party lines in an attempt to claw back their authority to weigh in on matters of war and peace.