WASHINGTON — President Barack Obama will return 5 percent of his salary to the US Treasury in a show of solidarity with federal workers hurting from $85 billion in government-wide spending cuts. Hundreds of thousands of workers could be forced to take unpaid leave if Congress does not reach an agreement soon to undo the cuts, which came as punishment for the inability of the Obama administration and Congress to come up with another way to address the country's gaping debt. The 5 percent that Obama will hand back mirrors the 5 percent cut that domestic agencies took when the reductions went into effect. The Pentagon's budget took an 8 percent hit. Every federal agency is grappling with spending cuts, which the White House has warned could affect everything from commercial airline flights to classrooms. A 5 percent cut from the president's salary of $400,000 per year amounts to $20,000. Obama will return a full $20,000 to the Treasury, said a White House official who was not authorized to discuss the decision publicly and spoke on condition of anonymity. “The salary for the president, as with members of Congress, is set by law and cannot be changed,” Obama spokesman Jay Carney said late Wednesday. “However, the president has decided that to share in the sacrifice being made by public servants across the federal government.” Wednesday's notice followed a similar move a day earlier by Defense Secretary Chuck Hagel, who committed to taking a salary cut equal to 14 days' pay — the same level of cut that other Defense Department civilians are being forced to take. Obama isn't the first president to give up part of his paycheck. John F. Kennedy donated his presidential salary to various charities, according to Stacey Chandler, an archivist at the John F. Kennedy Presidential Library. George Washington, the first president, tried to refuse a presidential salary, but Congress required that the position pay $25,000. Obama's salary is set by law, so he must accept the funds and then write a check to the Treasury each month for the portion he plans to give up. Obama's decision, first reported by The New York Times, won't affect the other perks afforded the president, from a mansion staffed with servants to the limousines, helicopters and Boeing 747 jumbo jet. — AP