U.S. President Barack Obama signed a bill early Thursday that ends a 16-day partial federal government shutdown and raises the nation's debt ceiling.

The White House confirmed that Obama inked the deal, hammered out by Democratic and Republican leaders in the Senate, just after midnight Wednesday.

The legislation was passed by an overwhelming 81-18 Wednesday evening in the Senate before the House of Representatives approved it by a comfortable margin of 285-144 a few hours later.

The congressional votes represented a defeat for the Republicans because they were unable to delay implementation of the 2010 Affordable Care Act, also known as Obamacare, as part of the agreement.

The deal guarantees sufficient funds to reopen the government and keep it open until Jan. 15, meaning that all furloughed federal employees were to be back to work on Thursday.

It also raises the nation's debt limit until Feb. 7, thus averting an unprecedented financial default.

Obama will give a statement Thursday morning on the last-minute deal and the U.S. government's challenges in the wake of the two-week disruption, the White House said.

The Senate deal establishes that a bipartisan and bicameral committee will negotiate a long-term budget agreement that is to be put up for a vote in December, according to legislative sources.

The agreement reached in the Senate "will give stability" to the country and will serve as a starting point on the road to "fiscal sustainability," Senate Majority leader Harry Reid (D-Nevada), who hammered out the deal with Senate Minority leader Mitch McConnell (R-Kentucky), said.

"We fought the good fight; we just didn't win," House Speaker John Boehner (R-Ohio) told an Ohio radio station Wednesday after saying he would allow the lower chamber to vote on the measure.

He was referring to GOP efforts to defund Obama's comprehensive health care overhaul and get deficit reduction concessions in exchange for funding the government and raising the federal borrowing limit.

The urgency to reach a deal became more acute Tuesday afternoon when credit rating agency Fitch announced it had put the United States' AAA credit rating on watch for a potential downgrade, citing the failure to raise the nation's $16.7 trillion debt ceiling with the Oct. 17 deadline fast approaching. EFE