The Senate on Friday passed legislation to ensure federal employees facing furloughs during a potential partial government shutdown are guaranteed back pay once the government reopens.

About 345,000 federal workers are set to be furloughed if Congress fails to act by midnight; those employees would not receive back pay for their furlough days unless Congress acts. The Senate approved the measure by unanimous consent—meaning no member voiced any opposition—as hopes for a spending deal wavered just hours before before the deadline.

An additional 500,000 federal employees will be forced to work during the shutdown, but they are already guaranteed back pay when agencies reopen. The departments of Transportation, Housing and Urban Development, State, Interior, Agriculture, Treasury, Commerce, Homeland Security and Justice, as well as other independent agencies such as NASA, the Environmental Protection Agency, the Office of Personnel Management and the White House Executive Office of the President, are operating under a continuing resolution set to expire Friday at midnight.

Congress has historically provided back pay for furloughed feds. A bipartisan pair of House lawmakers has already introduced companion legislation with dozens of cosponsors, but it has yet to receive a vote in the lower chamber.

Since Saturday is the last day of the two-week pay period, the Office of Management and Budget said in guidance to federal agencies on Friday that payroll processing would initially not be affected by a shutdown, and federal workers can expect to receive their regular paycheck at the normal time: sometime between Dec. 28 and Jan. 3. If a shutdown commences Friday night, federal workers who are scheduled to work on Dec. 22 will not receive pay for that day in their paycheck until after the government reopens and Congress authorizes back pay.

Sen. Chris Van Hollen, D-Md., who cosponsored the measure guaranteeing back pay for furloughed workers, thanked Republicans for allowing him to move forward with the bill on an expedited schedule. He expressed hope for avoiding a shutdown altogether, but said the measure would provide some degree of certainty for federal workers if a lapse in appropriations does occur.

Federal employees “should not be the ones to bear the burden, the penalty, of a shutdown,” Van Hollen said.

Sen. Ben Cardin, D-Md., who introduced the bill, underscored that even if the legislation becomes law, feds will face a significant inconvenience from a shutdown.

“They depend on a paycheck to meet their monthly and weekly needs,” Cardin said.

Van Hollen urged the House to take up the legislation “immediately.”