Maine Democrats pulled off a nearly impossible feat Tuesday, taking back both houses of the Legislature only two years after losing them in a national tea party Republican wave. Now comes the hard part: They will have to govern.

The final numbers are still coming in and some districts may be subject to recount, but it’s beyond dispute that there will be more Democrats than Republicans in the House and Senate.

Democrats will select the speaker of the House, the president of the Senate, the attorney general, secretary of state and treasurer. And perhaps more significantly, Gov. LePage will have to convince the Democrats that any measure he wants passed is a good idea.

Using election results to read the voters’ minds is always chancy, especially when you are talking about 186 different races. But when the trends are so strong, it’s fair to draw some conclusions. First, it’s clear that the Democrats recruited strong candidates who worked hard and delivered a consistent message about middle class opportunity. They were also helped by President Obama’s presence at the top of the ticket and his ability to appeal to Democratic-leaning younger voters who haven’t always showed up at the polls.

But they were also helped by a name that was not on the ballot. It is impossible to look at these results as anything other than a stinging rebuke of Gov. LePage and Republican control of state government over the last two years.

Republicans were offered a historic opportunity to set a new course for the Maine economy. They promised not to overreach, but under the governor’s leadership they did, forcing Maine into extreme ideological policies on health care, social services and tax policy.

The Democrats now have their turn to lead. If they can make the kinds of reforms that give people more economic opportunity and security, they will be rewarded. But if they see this as a chance to push through extreme policies from the ideological fringe, we could see another fast turn around. A lesson from this election is that Maine voters won’t wait long.