Leading article: For the Republicans, the real challenges lie ahead

It was a bad result for President Obama and the Democrats, as everyone knew it would be. They sustained the worst losses, across both Houses of Congress, since the Republican defeats of 1948.

But it was not quite as bad as the Democrats – and their many supporters around the world – had feared. While they lost control of the House of Representatives, they emerged with a bare majority in the Senate. Harry Reid clung to his Nevada Senate seat, which had been the totem for the Tea Party movement's success nationally; Democrats beat high-profile Tea Party candidates in Delaware and elsewhere, while Jerry Brown made a striking comeback to recapture the Governor's mansion in California in the face of a lavishly-funded campaign by the eBay founder, Meg Whitman.

In general, it seems, fewer Democrats stayed away than forecast and fewer Republicans than predicted succumbed to the seductive wiles of the Tea Party. After almost two years in office and some promised, but hugely controversial, legislation under his belt, Mr Obama has not lost all his political friends – though his former Illinois Senate seat passed, in a historic change, to the Republicans. From January, he and his party will have to accustom themselves to operating in the new political reality, with the House controlled by the Republicans and a Senate so finely balanced as to invite the blocking and filibustering that the Tea Party promised as a substitute for policy.

Whatever the priorities Mr Obama sets for the remainder of his term, he will find himself severely constrained unless, like Bill Clinton before him, he can devise ways of making common cause with the legislature he has been dealt. But while he lacks the one-time Arkansas governor's extensive experience of wheeler-dealing, there is no reason why Mr Obama should not be able to reach convincingly across the aisle. He came to office promising the same extended hand to the Republican Opposition as he offered to his country's former adversaries around the world – though, it has to be admitted, with even less success. He made a new offer of co-operation to House Republicans as the scale of their victory became apparent.

This could well turn out to be an astute move. For if Mr Obama and the Democrats are the clear losers from Tuesday's elections, the implications for the Republicans of their victory are more complicated than they might at first sight appear. Their dilemma now is at least as acute as the one that now faces Mr Obama, and could be more so. Deciding how to respond to the President's early olive branch will be the first, and crucial, test.

The fact that the Republicans' triumph was not as sweeping as they had hoped – and that some of the Tea Party's stars in particular failed to live up to their billing – could spark recriminations within the party. Even without public in-fighting, though, the party is clearly split between the conventional mainstream and angry sections of the grassroots. This could make it a potentially less effective counterweight to Mr Obama than it might otherwise be, and hamper the formulation of distinctive policies.

The Tea Party's uncompromising stance towards the Obama White House could also prove a liability, if it were to be seen to thwart possible Republican legislative achievements. And while midterm election victories are always welcome, the Presidency is by far the greater prize. From now on, the Republicans have to ensure that they wield their power in the House in such a way that it enhances, rather than hobbles, their chances in two years' time. Given the state of their party and the current balance of forces in Washington, that will be harder than it might look – and the campaign for 2012 begins now.