Italy has been slow-walking into a political crisis for weeks. Now it’s here.

Italian Prime Minister Giuseppe Conte resigned Tuesday, effectively collapsing the country’s government.

In a speech before the Italian Senate, Conte blamed his deputy prime minister, Matteo Salvini, for the mess, accusing him of being irresponsible and putting “his own interests and those of his party” ahead of Italy’s, at the risk of political and financial instability.

Conte is not totally wrong: Salvini has largely orchestrated this political drama.

Salvini, who leads the far-right, anti-immigrant Lega party, has been angling for weeks for snap elections, in the hopes that his rising popularity and success in May’s European Parliament elections would give him enough support that he could become prime minister outright after a new vote, or maybe with the support of smaller right-wing and far-right parties. Either way, the guy wants to become prime minister.

Italy just had elections in March 2018, and the fractured results forced an odd marriage between the anti-establishment Five Star Movement and the Lega party. It was a fragile coalition to begin with, and divisions between the two and Salvini’s recent power play made it recently untenable.

Salvini withdrew his support for the government earlier in August and called for a confidence vote, which was expected Monday. But Conte’s resignation effectively preempted the vote, upending the government anyway.

Conte’s attacked Salvini’s “irresponsible” actions for setting this crisis in motion. But Salvini said Tuesday he’d “do everything all over again.”

But it all might not work out as perfectly as Salvini originally plotted. Right now, there’s a chance he won’t get the fall elections he desperately desires. Instead, his scheme could backfire, and he might get kicked out of government altogether.

What the heck is going on in Italian politics, briefly explained

Matteo Salvini is pretty much what’s going on in Italian politics.

His rise to power fits into a broader resurgence of right-wing populism that swept Europe in recent years. When Salvini took over leadership of the Lega in 2013, it was a regionalist party with a narrow focus on northern Italy (its full name is Lega Nord, or Northern League), and it lacked national appeal.

Salvini helped changed that, especially in the lead-up to the 2018 elections. He pushed the party rightward and embraced a populist, “Italians first” message. Most notably, he embraced an anti-immigrant platform at a time when Italy was on the front lines of Europe’s refugee and migrant crisis.

A savvy politician, Salvini plays up the anti-elitist, “man of the people” vibe, and he’s skilled at promoting this persona on social media. This summer, he campaigned on Italy’s beaches, deejaying, snapping selfies, and going shirtless, where he showed off his “proletarian paunch.”

He also invokes religion a lot, something Conte criticized him for during his resignation speech on Tuesday, saying it “undermined the principle of secularism of the modern state.” Salvini, in response, kissed a rosary.

All of this has worked out well for Salvini so far. He’s arguably the most popular politician in Italy right now, and his Lega party is polling at 38 percent — very close to the number needed to fully take control of government. Salvini’s party also came in first in the European parliamentary elections in Italy, with his anti-EU campaign taking 34 percent of the vote.

What hasn’t worked out well for Salvini is the awkward coalition government he’s a member of, which consists of his party and the Five Star Movement.

The Five Star Movement is a true hodgepodge. Founded by a former comedian in 2009, the party’s only real unifying ideology is that it’s anti-establishment. Georgetown University political scientist Hans Noel described the party as “like what would happen if you put Bernie Sanders, Donald Trump, and Jon Stewart in a blender.”

But the Five Star Movement received the most votes — about 32 percent — in the elections in March 2018. The center-left coalition, led by the Democratic Party, came in second place. In third was the center-right coalition, which included Salvini’s Lega. Lega got about 17 percent of the vote.

Thus ensued a long and complicated process of trying to form a government, in which neither the left nor the right could do so without the support of the Five Star Movement. It flirted with both sides, but Five Star’s leader Luigi di Maio eventually reached a deal with Salvini to form a government.

Both party leaders became deputy prime ministers, and they brought in Conte — an independent law professor who had never held a political office — as a compromise choice to be the prime minister.

But the Five Star-Lega partnership was an odd fit from the start, and since the 2018 election, Salvini and Lega have gained in popularity, while support for the Five Star Movement has waned.

The Five Star Movement, new to government, struggled to keep pace — or match Salvini’s political savvy. Tensions arose between the two partners and sometimes spilled over into public feuding.

Salvini, buoyed by his popularity, saw a chance to increase his party’s power in government and perhaps become prime minister. In early August, just 14 months into the government, he declared that the coalition with the Five Star Movement had failed and the only way to break the deadlock was to hold new elections. He pushed a confidence vote to take down the government in the hopes of getting those elections this fall.

But Salvini may have miscalculated.

What happens next may not be what Salvini anticipated

As mentioned, Salvini called for a confidence vote earlier this month, which was expected Tuesday. But Conte sidestepped him by resigning, putting the power into the hands of Italy’s president, Sergio Mattarella, who would decide whether to accept Conte’s resignation. It also undercut Salvini. (Conte’s resignation didn’t cancel the confidence vote, but Salvini and Lega, perhaps recognizing their blunder, withdrew it anyway.)

Mattarella said he requested that Conte stay on as he figures out what’s next: either calling new elections or trying to piece together a new governing coalition with Italy’s party leaders.

This might be a caretaker-type government, meaning a coalition that would stay in power to pass some critical legislation and then disband in a few months, or a more long-term one that would last for the remainder of what should have been Conte’s five-year term.

But in either case, it could also mean Salvini gets pushed into the opposition and out of power altogether.

That’s because a possible option is a coalition between the center left, led by the Democratic Party, and the Five Star Movement — which would mean Lega, and Salvini with it, would be gone.

It would certainly be a twist if Salvini’s machinations ended with a center-left coalition in power. If that happens, Salvini can still be an agitator from the outside, and skilled politician that he is, he may be able to spin the narrative in his favor. But his influence within government — and his right-wing, anti-immigration policies — would be diminished.

Salvini seemed to realize this over the weekend, trying to make nice again with the Five Star Movement. But it looked to be too little, too late. The Five Star Movement leader di Maio called such offers “regretful” and “tardy,” and reports suggested that they’d already started making overtures to the center left.

But there’s no guarantee that the center-left Democratic Party and the Five Star Movement can work together. There are deep divisions within the center left about taking such a risk, and a lot of disagreements between the Democratic Party and the Five Star Movement. The two have rejected each other in the past. But necessity — the current political crisis and Salvini’s undeniable power grab — might bring them together now.

If it doesn’t, and Italian politicians can’t figure out any other way to form a government, then Italy is likely heading for a snap election, possibly in October.

Given Salvini and Lega’s current standing in the polls, the chances they would be victorious look good if there are elections soon.

A Salvini victory would put a far-right, anti-immigrant populist in charge of Europe’s third-largest economy, undoubtedly complicating the politics of the continent and the rest of the world during an already uncertain time.