WASHINGTON — President Obama quickly signed a budget compromise to reopen the federal government and avert the possibility of default after Congress approved it late Wednesday.

Treasury officials had said they would run out of money to pay the nation’s bills on Thursday unless Congress acted.

The deal suspends the $16.7-trillion limit on the government’s debt for several months, giving the Treasury renewed borrowing authority. The measure also will bring hundreds of thousands of federal workers back to work from furloughs.

Less than an hour after the House voted, and even before the president signed the bill, Yosemite National Park announced its roads and public areas would reopen immediately. The park’s visitor centers and valley campgrounds will open Thursday.

“We are excited to reopen and welcome visitors back to Yosemite,” park Supt. Don Neubacher said in a statement. “Autumn is a particularly special season to enjoy Yosemite’s colorful grandeur.”