But the opposition’s victory is incomplete, and the system it confronts is entrenched. Mr Maduro is not due to face an election until 2018. He has accepted the voters’ verdict but misunderstood its message. He blamed his party’s loss on an imaginary “economic war” against the government. Some leaders of the MUD hope that pragmatic chavistas will push Mr Maduro aside, roll back the barmiest Bolivarian policies and work with the opposition to rebuild democracy. It is more likely that the regime will subvert the new National Assembly.

What comes next

The opposition should therefore move to push Mr Maduro out of office through a recall referendum. That is a democratic procedure, allowed by Venezuela’s constitution. A successful recall would be followed by a presidential election, which the opposition would stand a good chance of winning, so long as it unites around a single candidate. Some may object that a recall vote would distract politicians from the more urgent task of relieving Venezuelans’ economic misery. The Economist has made a similar argument about the unjustified impeachment of Brazil’s president, Dilma Rousseff. But Brazil is not Venezuela. Ms Rousseff, for all her failings, leads a vigorous democracy and is at least trying to deal with her country’s economic problems. The same cannot be said of Mr Maduro.

Ordinary Venezuelans care less about who is in charge than about shortages, prices and jobs. Even under a new government, things will get worse before they get better. Reformers will have to devalue the bolívar, whose official level is nearly 150 times its black-market rate, raise the price of petrol, which now costs practically nothing, and reduce the budget deficit, which is roughly 20-30% of GDP. Devaluing the currency and freeing prices will push up inflation, which hits the poor hardest. A reforming government will need help from the IMF to cushion the pain of adjustment.

The opposition won the election with vague promises of change. To replace the bumbling Bolivarians, it must offer a plan to rescue the economy and be honest with voters about the sacrifices that will require. In the meantime, it should use its dominance of the legislature to repair Venezuela’s democracy. Freeing political prisoners, including Leopoldo López, an opposition leader, is just a start. The MUD’s two-thirds majority offers a chance to replace Supreme Court judges and election commissioners, who now answer slavishly to the regime. It must resist the temptation to replace one set of hacks with another. Chávez came to power because an earlier generation of leaders governed in the interests of a corrupt elite. Today’s victorious opposition must not make the same mistake.