WASHINGTON — Federal workers are set to get back pay for the shutdown because legislation to reopen the government contained language to guarantee it.

The government reopened Tuesday after a three-week funding patch was passed by Congress and signed by the president late Monday.

The continuing resolution mirrored language in the Federal Retroactive Pay Fairness Act — offered by Virginia Reps. Don Beyer, a Democrat, and Rob Wittman, a Republican and chairman of the House Armed Services Committee’s sea power panel — aimed at the pay issue. Together, the two represent nearly 120,000 federal employees.

“It is deeply disappointing that Congress was unable to prevent a government shutdown, but the passage of the our bill’s language should at least minimize the damage to rank-and-file civil servants,” Beyer said in a statement. “I thank my colleague Rep. Wittman for standing up for the federal workforce again, and hope that this will be the last time that this bill is necessary.”

There was some procedural maneuvering to have the measure pass Congress. The House added Beyer and Wittman’s language to the CR sent over by the Senate late Monday. After the House passed the CR, Senate Majority Leader Mitch McConnell obtained unanimous consent of the Senate to add the language retroactively to the original Senate bill.

During the shutdown, uniformed troops were considered essential and expected to report for duty. In 2013, 850,000 government civilians — considered nonessential — were placed on furlough.

Beyer and Wittman’s bill, which matched language passed in the wake of the 2013 shutdown, had accumulated 88 co-sponsors by the time the Senate passed the three-week CR.

“The effort is to hold [workers] harmless in all of this,” Wittman said ahead of the vote. “It’s really correcting things, assuring that when things get back in operation that paychecks go out, and they don’t have the pay deducted for the days they’re not here.”

Maryland Democratic Sen. Ben Cardin, whose state is home to more than 130,000 federal government employees, had offered a similar bill in the upper chamber, but the Senate’s Republican leadership repeatedly blocked it while broader negotiations were underway.