The budget battles of the fall of 2013 have come to an end.

President Barack Obama early Thursday morning signed a bill that opens the government and raises the nation's $16.7 trillion borrowing limit, putting an end to a 16-day federal government shutdown and ending the threat of a potential default on U.S. obligations.

The House of Representatives voted late Wednesday night to pass the bill by a 285-144 vote. Eighty-seven Republicans joined 198 Democrats in voting for the bill in the House. All 144 "no" votes were from Republicans.

Earlier, the Senate passed the bill by an overwhelming 81-18 margin. All 18 "no" votes came from Republicans, while 27 Republicans voted for the bill.

Office of Management and Budget Director Sylvia Burwell said in a statement after the bill had passed both chambers that federal employees "should expect to return to work in the morning."

"This has been a particularly challenging time for Federal employees, and I want to thank our nation’s dedicated civil servants for their continued commitment to serving the American people," Burwell said.

The bill was the result of an 11th-hour deal brokered by Senate Majority Leader Harry Reid and Minority Leader Mitch McConnell earlier Wednesday. It funds the government through Jan. 1 and suspends the nation's debt limit through Feb. 7. (For the full text of the bill, see here.)

"Let’s be honest: This was pain inflicted on our nation for no good reason, and we cannot make the same mistake again," Reid said after the Senate vote.

It also includes a measure of income verification for those receiving subsidies under the Affordable Care Act. In short, the Secretary of Human Health Services will submit a report no later than Jan. 1 detailing the verification process. The department's inspector general will submit to Congress no later than July a report on the effectiveness of those procedures.

House Speaker John Boehner let the bill come to the House floor and pass with mostly Democratic votes.

Obama delivered a statement from the White House Wednesday night after the Senate completed its vote, hailing leaders from both parties for reaching the agreement.

"Hopefully next time it won't be in the 11th hour," Obama said in very brief remarks from the White House briefing room. "We've got to stop governing by crisis."

The bill's final passage ended months of back-and-forth squabbling between the two parties, which first focused on conservatives' wish to defund the Affordable Care Act through the continuing resolution to keep the government funded.

In late September, Boehner went along with a plan backed by Sens. Ted Cruz (R-Texas) and Mike Lee (R-Utah), and the House initially passed a continuing resolution that stripped funding for Obamacare.

This led to legislative ping-ponging between the House and Senate ahead of the Sept. 30 deadline to keep the government funded. Ultimately, the two chambers couldn't agree on a deal, and the federal government entered into its first shutdown in 17 years.

It lasted 16 days.

Ultimately, the fight over the debt ceiling worked its way into the shutdown battle. Late last week, the two sides began discussing a deal that would resolve the two issues, but they couldn't agree over the weekend.

House leadership decided on Tuesday to move its own bill. That plan ended in disaster, as leadership couldn't amass enough GOP votes for the measure to pass after House conservatives revolted against the measure. That led to an immediate resumption of talks between Reid and McConnell, who announced the final deal at noon on the Senate floor Wednesday.