A staff member removes the Iranian flag from the stage after a group picture with foreign ministers and representatives of Unites States, Iran, China, Russia, Britain, Germany, France and the European Union during the Iran nuclear talks at the Vienna International Center in Vienna, Austria July 14, 2015. REUTERS/Carlos Barria

WASHINGTON (Reuters) - The U.S. House of Representatives narrowly approved legislation on Tuesday that would restrict President Barack Obama’s ability to lift sanctions under the international nuclear deal with Iran, nearly three weeks after a similar vote was canceled.

House members voted 246-181 to pass the “Iran Terror Finance Transparency Act,” almost entirely along party lines, with almost every “yes” vote coming from Republicans and Democrats overwhelmingly opposed to it.

The legislation is not expected to become law, even though Republicans control both the House and Senate. Even if it were passed by the Senate, Obama has promised a veto, saying the measure would kill the landmark nuclear agreement.

The House narrowly passed the legislation last month, but the vote was voided after nearly a third of the chamber showed up too late to cast their votes.

The voided vote took place on Jan. 13. On Jan. 16, U.S. and Iranian authorities announced a complex deal in which Iran released four American prisoners just as the international nuclear agreement was implemented.

Congressional aides said the House vote was voided because the new House speaker, Paul Ryan, was pushing members to arrive for votes on time, not because of any connection to the prisoner deal.

Democratic lawmakers noted that the repeated vote was not the only one in the House on Tuesday that evoked references to “Groundhog Day,” the 1993 film in which the character played by the actor Bill Murray lives the same day over and over again.

The Iran bill was passed just after House Republicans tried and failed to override Obama’s veto of legislation to repeal his healthcare law. House Republicans have voted more than 60 times to try to repeal the healthcare overhaul, one of the Democratic president’s signature domestic policy achievements.