WASHINGTON — Defense Secretary Chuck Hagel made a surprise announcement on Saturday that he would reinstate almost all of the 350,000 civilian employees of the Defense Department who had been sent home when the government shut down last week.

Mr. Hagel said “most DoD civilians” would be exempted from the furloughs and would return to work this week because Pentagon and Justice Department lawyers interpreted a stopgap budget measure signed into law last week by President Obama, which guaranteed pay for service members, to also apply to a larger number of civilian workers.

That action came as the House, in a rare Saturday session, voted unanimously to guarantee that federal workers would receive back pay once the shutdown ended, offering a promise of relief, if not an actual rescue, to more than one million government employees either furloughed or working without pay.

When the government shut down on Tuesday, about 350,000 of the Defense Department’s civilian work force of approximately 800,000 was ordered to stay home; military personnel are automatically exempted from the shutdown.