Hours ahead of the Treasury deadline that could have seen the US default for the first time in its history, the House of Representatives voted overwhelmingly in favour of a deal to raise the debt ceiling.
Reluctantly, both Democrats and Republicans voted the legislation through, although there were significant revolts on each side. It passed by 269 to 161 votes.
It will now be voted on by the Senate, although this is largely a formality as it has a Democratic majority. The House, which since November's mid-terms has been made up of many hardline Tea Party Republicans, was the main problem. Although the bill is seen by many as a complete capitulation by the president, many Republicans are still angry that the cuts outlined in the legislation do not go far enough.
While there is a sense of relief that the crisis has been ended without a potentially catastrophic default, Democrats are understandably frustrated as they have emerged from weeks of stand-off with little to show for it. Not only has Barack Obama surrendered on most of the key points, promising more than $2tn in spending cuts over the next ten years, but because a deal was reached so close to the deadline, the bill has not undergone the normal scrutiny.
It is a significant shift in fiscal policy at a time when economic recovery is fragile. Unemployment remains above 9 per cent, growth is slowing, and there is now no scope for any economic stimulus. Democrats also fear that it is the poor who will lose the most. In one of his main surrenders, Obama has agreed not to seek extra tax revenue. Given that George Bush's tax cuts for the rich are the main cause of the deficit (see this chart ), this means the deficit will stay sky-high. Democrats hope to re-open this debate at a later stage.
The sense that Obama has caved in to the unreasonable voices on the right is also a cause of frustration. Writing last night, the Nobel-winning economist Paul Krugman  criticised Obama for refusing to consider tabling the 14th Amendment to push his version through:
Those legal options are still there. Obama can move now; and even if he eventually loses in the courts, that gives him time.
Sure, it's risky. But the whole situation is immensely risky, thanks to the extremism and bloody-mindedness of the right. There are no safe options, and trying to play it safe when there is no safety lands you, well, where Obama is right now.
While laudable in theory, Obama's wish to seek reasonable, bipartisan solutions in the most partisan, extreme era the White House has seen for decades makes him a hostage to fortune.
The immediate crisis may have been averted, but this stand-off has shown how drastically the mainstream debate has been pulled to the right. It has also given a hint of the lines along which the next election will be fought -- drastically differing views on the size and scale of the state. Obama would do well to find his voice and be more assertive by then, if he does not want to lose the support of his own party.