BOLOGNA, Italy — Italy’s political establishment and European leaders should encourage the maverick 5Star Movement to enter government, despite the economic risks, after mainstream parties took a severe beating in Sunday’s general election.

Both the ruling center-left Democratic Party of former premier Matteo Renzi and the conservative Forza Italia of ex-Prime Minister Silvio Berlusconi were hammered by anti-system populists from the radical fringes, surfing on voter anger at politicians over austerity, mass migration and corruption. The vote, which produced a hung parliament, was a personal repudiation for both men.

Neither Renzi nor Berlusconi won enough seats to form a government with their own allies. Nor were their combined scores enough to form a German-style grand coalition to run the eurozone’s third biggest economy.

Rather than inventing endless ways to keep the same old guard in control against the will of a majority of Italians, it’s time to turn the keys of power over to new forces and let them cut their teeth — and come to terms with the harsh reality of trying to govern this fractious country.

“People preferred the genuine populists to the copies" — Mario Monti, former prime minister

The 5Stars, an anti-establishment protest movement created by comic Beppe Grillo and now led by 31-year-old Luigi Di Maio, was by far the biggest party. But the biggest winner of the night was arguably the anti-immigration, sovereignist League, which came out well ahead of Berlusconi’s Forza Italia, its primary partner in a right-wing coalition that emerged as the largest bloc, though short of an overall majority.

“People preferred the genuine populists to the copies,” former Prime Minister Mario Monti said in an interview, noting that both Berlusconi and Renzi had resorted to bashing Brussels in the past.

League leader Matteo Salvini has claimed the right to form a government, since his party overtook Berlusconi’s supporters. The League has governing experience, having run several northern regions successfully and served in past center-right national administrations.

The constitution gives President Sergio Matterella a free hand in appointing a prime minister, who proposes a Cabinet, which must win a confidence vote in both houses of parliament. Experts say the electoral law points toward giving first chance to the leader of the biggest coalition rather than the largest single party. That would mean nominating Salvini, if the rightist alliance holds together.

The northern firebrand’s hostility to the euro and hard-line stance on immigration make him unpalatable to the Italian and European establishment and scary to the financial markets, which took a mild hit on Monday after the results pointed to a stalemate. He may struggle to recruit the extra lawmakers to reach a majority despite the Italian tradition of trasformismo ("transformation"), in which individuals or groups of deputies cross the floor in return for promises of money or jobs.

A better option would be for the Democratic Party to challenge 5Stars to share national responsibility. True, the movement has floundered so far in trying to run the cities of Rome and Turin and has no central government experience. But Di Maio made some moves during the campaign to prepare it for entering government, declaring it was too late to leave the euro and downplaying its previous refusal to form coalitions with other forces.

Arithmetically, the 5Stars and the League have enough seats to govern together. But although both are anti-establishment gadflies that have vowed to destroy the traditional political class, they have little in common otherwise except hostility to immigration.

The League is largely a northern, working class and small business party with a right-wing economic agenda, even if it has dropped its northern separatist identity. It has promised budget-busting tax cuts. The 5Star Movement is stronger in the south, draws many of its voters from the left, disaffected middle-class and the young, and advocates direct internet democracy and a universal minimum income, which critics say would bankrupt Italy.

Personal ambition would also likely get in the way of any attempt by the two parties to work together.

“Salvini wouldn’t want to be a junior partner,” said Erik Jones, professor of European studies and international political economy at Johns Hopkins University’s School of Advanced International Studies in Bologna. “He’d rather enjoy the benefits of staying in opposition unless he can be prime minister.”

Either way, Italy is likely in for months of tortured coalition negotiations, during which outgoing Prime Minister Paolo Gentiloni’s center-left administration will remain in office with full powers until a successor can win a vote of confidence. The constitution sets no timeframe for forming a government.

Meanwhile, the European Commission is expected to step up its annual demands for Rome to carry out further structural economic reforms and tighten fiscal discipline to curb its huge public debt, which at 132.6 percent of gross domestic product is second highest in the eurozone after Greece. Financial markets may also raise pressure to avoid any splurge of public spending by raising the risk premium on Italian government bonds.

“It’s important to try to tame the 5Stars" — Gianfranco Pasquino, political scientist

Gianfranco Pasquino, a political scientist and a former left-wing senator, forecast an agonizing reappraisal on the center-left after Renzi announced his intention to resign as PD leader, following his party’s defeat.

The PD has vowed to go into opposition after Sunday’s crushing defeat, but it might be willing in a few months’ time to enter a coalition with the 5Stars if the rightist alliance fails to find a majority, he said, just as Germany’s Social Democratic Party agreed after the failure of center-right coalition negotiations to rejoin a government with Chancellor Angela Merkel’s conservatives.

A non-partisan government of technocrats such as the administration Monti formed under European pressure at the height of the eurozone crisis in 2012 is no longer an option because both the 5Stars and the right-wing alliance want to govern by themselves, Pasquino said.

But a government backed by the 5Stars and the PD might be feasible under a reformist such as former Culture Minister Dario Franceschini, centrist Economic Development Minister Carlo Calenda, or Finance Minister Pier Carlo Padoan, a distinguished economist, he suggested.

“It’s important to try to tame the 5Stars,” Pasquino said. “They are so close to power and to forming a government that they might be more willing to compromise.”

The PD should also consider giving its support to Di Maio or another moderate member of the 5Stars on a sensible policy platform, if that proves to be the only option to form a government.

That may not sound like much of a new broom to sweep out Italy’s rotten system. But it would at least have the merit of bringing a new generation from outside the old parties into office and giving them a chance to clean up politics. Given the poor alternatives, it’s worth a try.

Paul Taylor, contributing editor at POLITICO, writes the Europe At Large column.