The White House and Republicans painstakingly edged toward a deal to stave off a disastrous US debt default and end a partial government shutdown now sure to hit the two-week mark.
President Barack Obama met face-to-face with Republican senators and spoke by phone with Republican House Speaker John Boehner, as subordinates haggled over the terms of an eventual truce to a bitter standoff.
"We are obviously in a better place than we were a few days ago in terms of the constructive approach we have seen," White House spokesman Jay Carney said.
"But there is not an agreement."
Amid rising optimism for a deal, and multiple tracks of dialogue, the main principles of a compromise emerged in public statements from both sides.
It will include a temporary, or more permanent, extension to US borrowing authority -- without which Washington could begin to default on its obligations for the first time in history after October 17.
The government, shuttered since October 1, will be fully reopened, possibly on an interim basis, and there will be some kind of commitment from both sides to work towards an elusive deal to tackle the deficit, rein in spending and possibly reform social programs and some aspects of the tax code.
Late in the day, Obama and Boehner, longtime foes who have often struggled to close deals, had what both sides said was a constructive conversation.
But there were signs that the White House was driving a hard bargain, as spokesman Jay Carney said that a rise in the debt ceiling could not be linked to long-term fiscal talks with Republicans, because it could set up repeated threats of default in the coming months.
The White House said earlier in the week that it would be open to a six-week extension of the debt ceiling after October 17.
But, perhaps sensing that it now has the upper hand in the fight, it now appears to be looking for an extension of borrowing authority from the current $16.7 trillion level for a longer duration.
"It is still acceptable as a bare minimum, sure," Carney said.
One possible compromise plan is being offered by Republican Senator Susan Collins.
The measure would raise borrowing authority for up to a year, fund the government and repeal a tax on medical devices introduced under Obama's healthcare law -- as an incentive to get conservative Republicans on board.
Significantly, Carney did not rule out ending the medical devices tax -- as long as its revenue could be found elsewhere.
Such a solution would be somewhat of a face saver for Republicans who entered the showdown determined to leverage the need to raise the debt ceiling as a way to defund or delay so-called Obamacare.
Republicans from the lower house have offered to talk to Obama about a short-term resolution to fund the government, and then to move to long-term budget and fiscal talks.
But the president insists he will not negotiate until both the debt ceiling is raised and the government is reopened.
Republican senators emerged from the White House talks into a rainstorm, and told reporters they were optimistic.
Arizona Senator Jeff Flake said there had been a "good talk" but no deal was reached.
Senator Lindsey Graham said he was "confident that in the next 24 to 48 hours the House will produce a continuing resolution that will allow the government to be open in total."
Senator Mike Johanns added: "everybody is talking to everybody now, and I'm encouraged by that."
But Senate Majority Leader Harry Reid signaled that Democrats were driving a hard bargain.
The Senate will vote Saturday on a 15-month extension of the debt ceiling, to take the issue off the table until after the mid-term congressional elections next year.
While the measure is unlikely to become law because it needs House support, it could provide a template for an eventual solution in the event of a longer term fiscal deal between Obama and Republicans.
Hopes for a deal spurred a rally in Asian stocks overnight and Wall Street followed the trend into positive territory.
The Dow Jones Industrial Average finished up 111.04 (0.73 percent) to 15,237.11.
If the US debt ceiling is not raised by October 17, the Treasury would run out of money and could begin defaulting on US obligations for the first time in history, with likely dire consequences for the world economy.
US Treasury Secretary Jacob Lew said in a statement to the International Monetary Fund steering committee that Washington understood its reputation as a safe harbor was at risk.
"The United States cannot take this hard earned reputation for granted."
New signs of Republican flexibility may have been spurred by devastating polling numbers showing their party brand badly hurt by the political showdown.
An NBC News/Wall Street Journal poll showed 53 percent of those asked blamed Republicans for the government shutdown and only 31 percent pinned the blame on Obama.
Meanwhile, G20 finance ministers meeting in Washington demanded urgent action.
"The US needs to take urgent action to address short-term fiscal uncertainties," the group of leading economies said in a statement.