WASHINGTON — The White House relented on Tuesday and said President Obama would sign a compromise bill giving Congress a voice on the proposed nuclear accord with Iran as the Senate Foreign Relations Committee, in rare unanimous agreement, moved the legislation to the full Senate for a vote.

An unusual alliance of Republican opponents of the nuclear deal and some of Mr. Obama’s strongest Democratic supporters demanded a congressional role as international negotiators work to turn this month’s nuclear framework into a final deal by June 30. White House officials insisted they extracted crucial last-minute concessions. Republicans — and many Democrats — said the president simply got overrun.

“We’re involved here. We have to be involved here,” said Senator Benjamin L. Cardin of Maryland, the committee’s ranking Democrat, who served as a bridge between the White House and Republicans as they negotiated changes in the days before the committee’s vote on Tuesday. “Only Congress can change or permanently modify the sanctions regime.”

The essence of the legislation is that Congress will have a chance to vote on whatever deal emerges with Iran — if one is reached by June 30 — but in a way that would be extremely difficult for Mr. Obama to lose, allowing Secretary of State John Kerry to tell his Iranian counterpart that the risk that an agreement would be upended on Capitol Hill is limited.