WASHINGTON — The House, in a rare Saturday session, voted unanimously to guarantee that federal workers will receive back pay once the government shutdown ends, offering a promise of relief if not an actual rescue to more than 1 million government employees either furloughed or working without pay.

The 407-to-0 vote, on a measure backed by President Obama, followed a morning debate in which lawmakers from both parties extolled government doctors and nurses saving lives, emergency relief workers braving disasters to rescue citizens, and NASA scientists exploring space. In 2011, many of those same lawmakers, swept to power on a Tea Party wave, pressed for legislation imposing a hard freeze on government salaries and held hearings on a federal work force they said was overpaid and bloated.

After the vote, Representative Eric Cantor of Virginia, the House majority leader, criticized Mr. Obama for what he called a failure of leadership for refusing to negotiate a way out of the impasse. But he said Republican leaders would not allow a vote to reopen the government without delivering a blow to the president’s health care law, with a delay in the mandate that individuals purchase health insurance and a prohibition on federal subsidies for members of Congress, White House leaders and their staff, who must purchase policies on the law’s new insurance exchanges.

“The Republican position has been and continues to be no special treatment under the law, no special treatment under Obamacare,” Mr. Cantor said.