Five years ago, when her party won 6 percent of the vote in elections for the European Parliament, Giorgia Meloni tried to pop a bottle of sparkling wine, but the cork awkwardly flopped among some supporters.

This week Ms. Meloni, now Italy’s prime minister, emerged as a big winner in the elections, and she and dozens of members of her Brothers of Italy party celebrated at a five-star hotel in Rome where waiters carried the wine bottles in silver basins filled with ice. The hard-right party took nearly 29 percent of the vote. The victory was all the more significant because Ms. Meloni was the only leader of a major Western European country to emerge reinforced from the balloting.

For Ms. Meloni, the lift could hardly have come at a better time. All eyes are on Italy this week as Ms. Meloni prepares to host a summit of the Group of 7 major economies for three days starting on Thursday. It’s another opportunity to cast herself as a legitimate member of the club of the world’s most influential leaders.

“This nation goes to the G7 and to Europe with the strongest government of all,” she told supporters early on Monday after the results came in. “They could not stop us.”