Brussels' nightmare — a Euroskeptic government in one of the EU's largest countries — could become reality as soon as next week.

The leaders of Italy's anti-establishment 5Stars and far-right League are putting the final touches on a coalition agreement they have pledged to deliver to Italian President Sergio Mattarella "by Monday." 5Star leader Luigi Di Maio emerged from a meeting with League leader Matteo Salvini Thursday to say there were still a few “minor details” to be hammered out. Among those: Who will be the country's next prime minister.

Here's POLITICO's guide to what happens next.

What's at stake?

A 5Stars-League government would be the biggest challenge to Brussels since Brexit. The coalition agreement contains proposals to renegotiate Italy's public debt, throw off the yoke of austerity and reopen the European Union's treaties to reduce the bloc's powers. It also states that Russia is “not a military threat.”

How close are the 5Stars and the League to reaching a deal?

The games are not yet over. “The 5Stars-League have a thin majority, and the two parties have very different backgrounds, so a last minute collapse in negotiations cannot be ruled out,” is how a UBS note for investors put it Thursday. Yet the majority of analysts agree that the founder of the 5Stars, Beppe Grillo, was right when he said in an interview a few days ago: “It will take some more time, but it will happen.”

A 5Stars-League government would also likely stand in the way of French President Emmanuel Macron’s ambitious plans for eurozone reform.

Who are the contenders for prime minister?

As the largest party of the two in parliament, the 5Stars will get the top job, but the League will have a say over who it is.

The frontrunner: Di Maio is the frontrunner in race to Palazzo Chigi, where the prime minister’s office is located. The 31-year-old politician has already served as vice president of the Italian lower chamber and has been formally leading the party since 2017. The League, however, seems to prefer a minor figure of the party as prime ministerial candidate.

Mr. Wolf: Alfonso Bonafede is a 5Star parliamentarian whose name has been floated in Italian media for two days as a potential prime minister. A close ally of the movement’s leader Di Maio, the 42-year-old native from Sicily is a lawyer by training and has built a reputation for being a problem solver, hence the nickname “Mr. Wolf,” a reference to the fixer in Quentin Tarantino’s “Pulp Fiction.”

The shadow man: Vincenzo Spadafora is described by Italian media as the éminence grise of the movement, the kingmaker quietly working behind the scenes. The 44-year-old Napoli native began his political career in 1998 serving in several left and center-left administrations. He already has an autobiography called "The third Italy, a manifesto of a country that does not hold back."

If the 5Stars get the PM, what does the League get in return?

In a Facebook live video on Wednesday, Salvini made a clear reference to his party gaining control over the powerful interior ministry, also known as Viminale, potentially with the leader himself at its head. As interior minister, Salvini would be able to implement the draconian security and immigration measures he campaigned on.

The League is also very keen on bagging the ministry for economic development, which would give the party control over trade policies. That would allow Salvini to push a more protectionist agenda in defense of "made in Italy."

Do the parties get a say?

Yes. Tomorrow or over the weekend, party members will be consulted on the deal (in the case of the 5Stars with an online vote). The major problem could be 5Stars rank and file. The party got almost 11 million votes in the March 4 election, but about 20 percent of these voters had cast ballots for the center-left Democratic Party in the previous election in 2013. The coalition program is very tough on migration and on Europe, and this could push left-leaning 5Star party members to reject it. If that happens, it is unclear whether this would torpedo the deal, or mean the two parties have to go back to the negotiating table.

What role does the president play?

If the deal passes muster with members, the parties will present it to President Mattarella. As guarantor of Italy's constitution and international treaties, he has the power to approve or reject ministers and even specific bills in the government's program if he deems them to be unaffordable. He can even reject the coalition government altogether and appoint his own — a power that has been used once before, in 1953.

If all goes to plan, when will the new government officially start work?

Once the president has given his approval, the prime minister will begin selecting his or her ministers. After around 10 days, the new government will be subject to confidence votes in both houses of parliament, marking its official start.

What would it mean for Italy?

Some big changes. The joint program includes tax cuts, stronger unemployment subsidies and adjustments to pension reforms, partly funded by recovering unpaid taxes, a drive against tax evasion, and a reduction in some government expenses. On migration, the deal envisages detaining irregular migrants in the country and sending around half a million back to their countries of origin, among other measures.

If the government survives to the end of its five-year term, the two parties would be able to put forth a new presidential candidate, opening up the possibility of installing a powerful Euroskeptic whose influence on Italy will outlive the administration.

What would it mean for the EU?

The first signs could be visible very soon. In June, the European Council will have to roll over the Russian sanctions that the two parties strongly oppose. Last month Kurt Volker, U.S. President Donald Trump's special envoy for Ukraine, warned Rome that “Italy cannot lift the measures without serious consequences.”

A 5Stars-League government would also likely stand in the way of French President Emmanuel Macron's ambitious plans for eurozone reform. And the EU awkward-squad, including Poland and Hungary, will gain a new ally.