J. Scott Applewhite / AP Senate majority leader Harry Reid and Democratic leaders speak with reporters in Washington on Oct. 16, 2013

President Barack Obama signed a bill to reopen the federal government and lift the debt limit just after midnight on Thursday morning, after an 11th-hour agreement reached on Wednesday by Senate majority leader Harry Reid and minority leader Mitch McConnell was passed by the Senate and the House of Representatives. The Senate voted 81-18 in favor of the measure, while the House voted 285-144 in favor.

The bipartisan votes in both houses of Congress set the stage for an end to the 16-day government shutdown hours before the federal government’s borrowing authority is set to expire. Speaker of the House John Boehner conceded earlier on Wednesday that his conference’s strategy to demand concessions in exchange for reopening the government had failed. “Blocking the bipartisan agreement reached today by the members of the Senate will not be a tactic for us,” he said in a statement.

In a statement in the White House briefing room after the Senate vote but before the House took up the measure, President Barack Obama said, “Once this agreement arrives on my desk, I will sign it immediately.” Obama said he hoped lawmakers in both parties would learn from the shutdown and swear off governing by crisis.

“I’m eager to work with anybody, Democrat or Republican,” Obama added, saying he had more to say about future budget negotiations after the agreement on Thursday. “I’ve never believed Democrats have a monopoly on good ideas.”

Asked whether he was concerned about this process repeating itself in just a few months, Obama replied simply, “No.”

The only votes against the measure in the Senate came from conservative Republicans, including Senators Ted Cruz, Rand Paul and Marco Rubio, in addition to several members wary of primary challengers. In the House, a majority of Republicans voted against the measure, including Budget Committee chairman Paul Ryan.

With the passage of the legislation, Sylvia Mathews Burwell, the director of the Office of Management and Budget, said in a statement late on Wednesday that furloughed federal employees should prepare to return to work on Thursday morning.

“Now that the bill has passed the United States Senate and the House of Representatives, the President plans to sign it tonight and employees should expect to return to work in the morning,” she said. “Employees should be checking the news and [the Office of Personnel Management] website for further updates.”

Roughly 800,000 federal employees have been furloughed since midnight on Oct. 1 when the government began a new fiscal year without a budget. Hundreds of thousands of others, deemed “essential” employees, were required to work without pay. The new funding bill will extend back pay to all workers affected by the shutdown.

White House Press Secretary Jay Carney said on Wednesday he did not know how long it would take for the federal government to return to normal operations once funding has been restored.

As part of the agreement, the House and Senate approved the appointment of budget negotiators after Republicans dropped their long-standing opposition to beginning the process. Lawmakers on the committee have until Dec. 13 to reconcile the vastly different House and Senate budgets.

The agreement funds the federal government in place of an annual budget through Jan. 15, 2014 and lifts the debt limit through Feb. 7, 2014.

— With reporting by Alex Rogers / Washington