Luigi Di Maio, left, the Italian Five Star Movement’s leader, poses with party founder Beppe Grillo in Rome on March 5, one day after the party won the highest share of votes in recent elections. (Alessandro Di Meo/ANSA/AP)

Italy’s parliamentary election Sunday gave a major boost to outsider parties, including the Five Star Movement, which claimed the largest share of the vote (32 percent) as well as the far-right League. Meanwhile, center parties of the left and right fared worse. The ruling Democratic Party garnered only 18 percent of the vote. The League wiped out former prime minister Silvio Berlusconi’s Forza Italia, which some thought would lead a center-right coalition.

If the traditional parties want to regain their power in Italy, there is one place they may need to start: social media. It was the outside parties that had the stronger social media presence. This alone may not have led to their victory, but it certainly illustrates a significant area of strength.

One example is the Five Star Movement. It emerged in 2009 as a movement designed around direct democracy and the Internet. Founder Giuseppe Grillo, a comedian, used his blog to communicate directly with supporters, bypassing traditional media sources.

The graph below shows that over the past five years the Five Star Movement built a social media following larger than any other party’s as measured by the cumulative number of “likes” made on its Facebook posts. Facebook users liked the Five Star Movement almost 6.5 million times in the past two years alone. Right behind it was the CasaPound, a neo-fascist party that has opposed immigration and the European Union. By contrast, the ruling Democratic Party received about 1 million likes in the same period. Several other parties, including the League, garnered increased online attention only in the past month. The leftist Democratic and Progressive Movement and the Italian Left barely register on the graph.

The second graph shows weekly number of “likes” made on posts shared on the Facebook pages of the leaders of the four parties that won the highest share of Sunday’s vote. The League’s leader Matteo Salvini received even more attention than the M5S’s Di Maio. But both consistently received more attention than Berlusconi and Renzi, neither of whom received more than 250,000 likes in a given week.

As the election results were announced, Salvini attributed their success to social media: “Thank God we have the Internet, thank God we have Facebook.” It remains to be seen how much social media actually affected the election’s outcome, but clearly sites like Facebook represent a source of strength for Italy’s ascendant parties — including parties promoting a renewed nationalism and hostility toward immigrants.

The same has happened elsewhere in Europe: Anti-immigrant parties like the AfD in Germany and the UKIP in the United Kingdom also rely heavily on social media. Marginalizing these extremist voices means finding ways to reinvigorate mainstream parties. Strengthening those parties’ social media presence is arguably an important first step.

Mabel Berezin is professor of sociology at Cornell University and is the author of “Illiberal Politics in Neoliberal Times: Culture, Security, and Populism in the New Europe” (Cambridge 2009) and “Making the Fascist Self” (Cornell 1997). She is writing a monograph on extremist politics in contemporary Europe. Follow her on Twitter @mabelberezin.

Thomas Davidson is a graduate student in the department of sociology at Cornell University. He uses computational methods including social network analysis, natural language processing and machine learning to study social movements and political parties. Find him on Twitter @thomasrdavidson.