The US Senate has announced a last-minute deal to avert a potentially damaging debt default and to reopen the government after a two-week shutdown.
Even if the Senate and House of Representatives manage to overcome procedural hurdles to seal the deal before tomorrow it will only be a temporary solution that sets up the prospect of another showdown early next year.
Senate Majority Leader Harry Reid and Republican leader Mitch McConnell announced the agreement on the Senate floor, where it was expected to win swift approval.
A main Republican critic of the deal, Senator Ted Cruz of Texas, said he would not use procedural moves to delay a vote.
The proposed deal does not contain demands by House Republicans to rollback President Barack Obama's healthcare overhaul.
Weeks of bitter fighting among Democrats and Republicans over President Barack Obama's signature healthcare reform law led to a partial government shutdown on 1 October.
It sidelined hundreds of thousands of federal workers.
Mr Cruz and other Republicans backed by the conservative Tea Party movement want to repeal or delay the healthcare law.
The initial fight over the healthcare law turned into a bigger argument over the debt ceiling, threatening a default that would have reverberations around the world.
Both Democrats and Republicans are confident that the US House of Representatives will have enough votes today to pass the bipartisan Senate plan, a top Democratic aide said.
Aides to House Speaker John Boehner, the top Republican in Congress, called senior Senate staff to say the House would vote first on the measure.
The aide said it appears certain to be approved with mostly Democratic votes.
Mr Boehner has been under pressure from conservative members of the House not to call a vote relying on Democratic votes.
His job may be on the line if they continue their opposition to the Senate deal.
Analysts and US officials say the government will still have roughly $30bn (?22bn) in cash to pay many obligations for at least a few days after 17 October.
The financial sector may begin to seize up if the deal is not finalised in both chambers.
The deal that emerged would basically give Mr Obama what he has demanded for months: A straight-forward debt limit hike and government funding bill.
The deal would extend US borrowing authority until 7 February, although the Treasury Department would have tools to temporarily extend its borrowing capacity beyond that date if Congress failed to act early next year.
It would also fund government agencies until 15 January.
Uncertainty over the shut down and the debt ceiling have already taken a toll on the economy and on confidence in US assets.
Major US stock indexes rose more than 1% on optimism that politicians were finally reaching a deal to end the weeks-long fiscal impasse.