ROME — Finished at last with their three-month job of forming a government, Italy’s populists on Friday recited oaths, shook hands and began a job that could prove even more challenging: running the euro zone’s third-largest economy while risking a deep conflict with the European Union.

Italy’s new government has signaled it doesn’t intend to leave Europe’s single currency, easing the most acute concerns. But even with that threat averted for now, Italy’s populist coalition, in a bid to fulfill campaign promises, could test Europe on issues ranging from migration to spending.

For a continent already strained by Britain’s exit from the E.U. and an increasingly uncertain relationship with the United States, Italy represents a different kind of peril. It is a core European Union member willing to push back against European Union policies and norms. In a note of congratulations Friday, European Council president Donald Tusk said it was a “crucial time” for Italy and the E.U. 

“We need unity and solidarity more than ever,” Tusk said. 

Italy’s populists, so far, have offered Europe conflicting signs about the approach they will take. The dramatic deal to form a government — and win sign-off from President Sergio Mattarella — was only clinched when the leaders swapped out a fierce euro critic for the finance minister job. Italy’s new government also chose as foreign minister Enzo Moavero Milanesi, whom one analyst on Friday called “a piece of the Italian-European establishment if ever there was one.”

But the two parties that overturned Italy’s political power structure also have reason to stick with the anti-Europe message, because that is what helped bring them to power. The anti-establishment Five Star Movement and the hard-right League have talked relentlessly about renegotiating European rules and fiscal limits. They have called on Europe to help find a more equitable solution for settling migrants and ease the burden on Italy, a top entry point for immigrants crossing the Mediterranean. The League, in particular, has taken a strident anti-migrant stance, campaigning on the deportation of 600,000 people.

“These guys were supposed to overturn the world,” said Giovanni Orsina, a professor at the LUISS Guido Carli University in Rome, who said he already sees some indications of normalization. “They promised the moon and now they get to govern. They will need to show voters they are moving.”

Just before the ceremony in which law professor Giuseppe Conte was sworn in as prime minister, one of the new government’s leading figures, Matteo Salvini, used a Facebook post to criticize European Commission president Jean-Claude Juncker. Juncker had been quoted in one news outlet as suggesting that Italians should work harder and be less corrupt — a comment Juncker’s spokesman said was misrepresented. But Salvini, on his official Facebook account, called Juncker’s comments “shameful and racist.” Salvini’s post included his familiar hashtag, #Italiansfirst.

Much of the concern about Italy’s new government stems from its promise of a powerful injection of spending, including new subsidies for the poor and unemployed. The coalition wants to repeal an unpopular pension restructuring that was drawn up during the height of the euro crisis as a way to bolster Italy’s coffers. The proposed changes are a potent nod to voter frustration in a country where the economy has scarcely grown in two decades. But the D.C.-based Peterson Institute for International Economics, in a research paper, said last week that the coalition’s fiscal plans were a “recipe for a debt crisis” that would “put it on collision course with financial markets and the European Union,” which has rules designed to keep debt in check. 

“I think Europe is worried,” said Massimo Franco, a columnist at the Corriere della Sera newspaper. “Italy knows well that we still have to deal with Europe. But the problem will be about expenditures.” 

As the new government was sworn in, Milan’s major stock exchange was up 1.5 percent on the day, and Italian borrowing costs — which had spiked during a topsy-turvy week — were falling closer in line with other European countries. 

Meantime, at the Quirinale, Italy’s presidential palace, Conte and 18 cabinet members were lining up for a ceremony that resembled any other government initiation in Rome. The walls of the room were gilded. Crystal chandeliers hung overhead. Italian and European Union flags flanked a desk where, one by one, the new government members approached and vowed to “respect the letter of the constitution.” 

When posing for photos, Five Star leader Luigi Di Maio stood at the far end of the front row, next to Salvini. Both tried to hold back their smiles. After it was over, reporters spotted Salvini walking out of the palace and asked him how long he thought the new government would last. 

“At least 10 years,” he said.

Stefano Pitrelli contributed to this report.