Senate Majority Leader Harry Reid, left, speaks on the Senate floor Wednesday announcing a short-term budget deal that was agreed to with Senate Minority Leader Mitch McConnell, right. U.S. Senate TV via Reuters

The Senate voted 81-18 to pass a last-minute bipartisan bill Wednesday to fend off a looming U.S. default and to reopen the federal government. The bill will now move onto the House, where representatives will conduct another vote. If they too vote to pass the bill, President Barack Obama will sign it into law and the country will have, at least temporarily, averted a financial crisis some analysts warned could trigger another recession.

“Once this agreement arrives on my desk, I will sign it immediately," Obama said at a press conference following the Senate vote. He added that the federal government would reopen "immediately."

Congress reconvened Wednesday with just hours to go until a deadline to raise the debt ceiling or see America potentially miss its payment obligations for the first time in history.

Shortly after midday, Senate Democrat Majority leader Harry Reid announced an agreement that would avert the default and reopen government — subject to a shutdown that began on Oct. 1.

"The compromise we reached will provide our economy with the stability it desperately needs," Reid said.

Reid announced on the Senate floor Wednesday that the deal would fund the government through Jan. 15 and averts default through Feb. 7. Reid said that time would allow Congress to work toward a long-term agreement that would prevent such frequent crises.

"After weeks spent facing off across a partisan divide that often seemed too wide to cross, our country came to the brink of a disaster, but in the end, political adversaries set aside their differences and disagreements to prevent that disaster. I thank the Republican leader for his diligent efforts to reach this important agreement," Reid said, speaking of Sen. Mitch McConnell.

Republican Senator Ted Cruz, who had been eyed as a potential barrier to the bill's smooth progress, said he did not intend to delay its passage. That was a key concession that signaled a strong possibility that both houses could act by day's end.

A Senate breakthrough has been in the air since Reid and McConnell resumed talks Tuesday night. Aides for both voiced optimism about striking an agreement Wednesday that could pass both houses of Congress and reach President Barack Obama's desk before Thursday, when the U.S. Treasury says it will begin running out of cash.

The Dow Jones industrial average surged 200 points Wednesday morning on news that Washington was closing in on a deal.