The U.S. Senate voted Wednesday night to approve a last-minute compromise to reopen the federal government and raise the debt ceiling to avoid a potential U.S. default on its debts.
The bill passed 81 to 18. It now goes to the House of Representatives, where Speaker John Boehner says Republicans will not block it.
President Barack Obama says when the bill reaches his desk, he will he will sign it immediately and the government will reopen immediately.
Mr. Obama thanked leaders of both parties and said it is time to earn back the lost trust of the American people.
Senate Majority Leader Harry Reid, a Democrat, and his Republican colleague Mitch McConnell put together the composite bill Wednesday, a day before the current debt ceiling expires.
The bill would keep the government running until at least January 15 and raise the borrowing limit enough to put off the risk of default until at least February 7. In the meantime, lawmakers would negotiate on spending cuts.
Reid called the government shutdown and anxiety caused by a possible default a manufactured crisis that inflicted pain on the country for no good reason.
If the debt ceiling was not raised, the United States would lose the authority to borrow money to keep paying its bills.
The government shut down on October 1 when the Senate rejected House demands to defund or delay President Obama's health care law as part of a spending bill. The president has said he will not negotiate any changes in the law until the government reopens.
House Speaker John Boehner said House Republicans fought with everything they had to force negotiations on the law, nicknamed "Obamacare." He said his party will continue to push for legislative oversight and highlight perceived flaws in the scheme.