President Obama has been reelected. But so has the Republican House of Representatives and a filibuster-capable Republican contingent in the Senate. The success of Obama’s second term — and of the country over the next four years — depends not just on the president’s actions, but the immediate lessons Republicans take from Tuesday’s vote.

There will be a split in the party.

One faction will admit that Americans have not renewed any mandate Republicans thought they gained in 2010 to unwaveringly oppose the Obama agenda. Voters in 2012 elected an ideologically mixed government to guide the country through a series of difficult challenges that Congress and the president must face together. The first will come a matter of days after the election as the automatic spending cuts and tax hikes of January’s “fiscal cliff” loom. Voters did not enthusiastically endorse the Obama agenda. The president’s margin of victory was thin, a fact Republicans can use to advance their priorities in the bargaining to come. But the electorate also did not endorse the Tea Party. Cooperation will be necessary.

In September, even some conservative senators signalled they would deal with a reelected Obama on taxes, while remaining firm in advancing GOP priorities. They began talking about trades that independent observers have been advocating for years: revenue increases, which Obama wants, in exchange for authentic Medicare reform, which Republicans want. This could be great for the country.

Other Republicans, though, will find any ideologically comfortable excuse they can to explain away Obama’s victory. The media was in the tank for the president, who constantly and flagrantly lied. Americans did not know just how radical the president has been, in the past or the present. There were voting irregularities here or there. The hurricane did it. Most of all, the thinking will go, Republicans had a flawed candidate. Though Mitt Romney elevated Paul Ryan and rallied his campaign in October, he was not a consistent conservative who offered a sharp enough critique of the president. Conveniently, this line of thinking offers right-wingers license to be only more unwavering and reckless in their opposition to Obama.

Those in the second camp will be wrong about how and why Romney lost, and about how to react. In fact, Romney ultimately proved to be an able campaigner in a shallow contest. Meanwhile, one of Romney’s greatest weaknesses, his serial inconsistency, resulted from the hard right turn the GOP base required him to take in Republican primaries, in 2008 but especially in 2012. America’s divided government and divided electorate will not accommodate ideological purity.

With luck, more Republicans will sort themselves into the first camp than into the second. Even if that does happen, though, among the huge political and policy challenges of the next four years will be getting more Republicans to recognize and extend their hand toward the center, instead of believing that their only salvation lies in dragging the rest of country their direction. President Obama must take on that challenge with a commitment he didn’t demonstrate in his first term. House Speaker John Boehner (R), whom everyone in Washington sees as a dealmaker rather than a bomb-thrower, has even more responsibility to try harder. Obama and the Republican House, after all, are stuck with each other.