The White House says Obama signed the bill early Thursday, hours after the House gave final approval.
The White House budget office has already instructed federal workers to plan to return to work Thursday morning.
The measure restores funding for the government through Jan. 15 and extends the nation's borrowing authority through Feb. 7.
The partial government shutdown started Oct. 1. The U.S. was to reach its debt limit Thursday if no deal was reached.
As the deal neared final passage in the House Wednesday, Obama said it was now time for leaders in Washington to win back the trust of Americans that was lost during the debt-and-spending crisis.