WASHINGTON – Federal employees who have been forced to take unpaid leave because of the partial government shutdown will get back pay.

President Donald Trump signed legislation Wednesday guaranteeing that furloughed workers will be paid retroactively.

The legislation, which cleared both the House and the Senate last week, does not spell out specifically when workers will see the money but says they will be paid as soon as possible when the shutdown ends.

“The partial government shutdown represents a failure to govern and harms not only those who need to interact with the closed agencies, but also hundreds of thousands of federal employees and their families who don’t know when they will receive their next paycheck,” said Sen. Susan Collins. R-Maine, one of the bill’s sponsors.

Some 380,000 federal employees from nine departments and several smaller agencies have been forced to go on furlough because of the government shutdown, which is now in its 26th day – the longest in U.S. history.

Another 420,000 employees – many in public-safety positions – are working without pay because their jobs are considered essential. They were assured of back pay once the shutdown is over.

Without legislation, however, there was no guarantee that furloughed workers would receive back pay when funding to their agencies is restored, although that has been the practice following previous shutdowns.

Last Friday marked the first time that affected workers have not received a paycheck since the shutdown began on Dec. 22.

The bill that Trump signed into law applies not only to workers furloughed during the current shutdown. It mandates that workers furloughed in future shutdowns also get back pay.

The current shutdown was triggered by a fight between Trump and congressional Democrats over funding for a wall along the U.S-Mexico border. Trump wants $5.7 billion to build the structure, but Democrats say a wall would be costly, ineffective and – in the words of House Speaker Nancy Pelosi – an "immorality."

More:Citing 'security concerns' due to government shutdown, Speaker Pelosi urges delay of State of the Union address

More:Government shutdown: Food banks worry about having enough supplies if stalemate drags on