Bernie Sanders supporters switched their allegiance to Donald Trump in large enough numbers last November to sway the election for the real estate billionaire, according to an analysis of voter data released Tuesday by the blog Political Wire. Since Trump's shock victory over Hillary Clinton, much discussion has focused on the degree to which passionate Sanders supporters' refusal to embrace Clinton led to the Republican winding up in the White House.

Bernie Sanders Voters Helped Trump Win

Related: Bernie Sanders is working with Democrats now, but will he be their pick for president in 2020?

According to the analysis of the 2016 Cooperative Congressional Election Survey, fewer than 80 percent of those who voted for Sanders, an independent, in the Democratic primary did the same for Clinton when she faced off against Trump a few months later. What's more, 12 percent of those who backed Sanders actually cast a vote for Trump.

The impact of those votes was significant. In each of the three states that ultimately swung the election for Trump—Michigan, Wisconsin and Pennsylvania—Trump's margin of victory over Clinton was smaller than the number of Sanders voters who gave him their vote.

While the self-confessed socialist Sanders and the "America first" embracing Trump represent polar opposites on the ideological spectrum, they both carried an outsider message and appealed to voters frustrated with the staid political establishment. Although Sanders railed against the policies and rhetoric offered up by Trump, the Republican at times sought to reach out to Sanders voters, emphasizing the similarities of the two candidates' positions on issues like trade.

The data would suggest that Trump's efforts were at least in part successful. Another factor, however, was that of those who switched their allegiance from Sanders to Trump less than 10 percent considered themselves strong Democrats, while less than 50 percent even leaned Democrat.

During the campaign, Sanders was criticized by many in the Democratic establishment for taking his primary battle with Clinton all the way into the summer. The Vermont senator did, though, ultimately endorse Clinton and campaigned on her behalf. At the same time, leaked emails suggested that the Democratic National Committee undermined Sanders's efforts during the campaign.

While much was made of the so-called Bernie-or-bust phenomenon, the number of Sanders supporters who crossed party lines to vote for Trump in 2016 may not be that unusual. A 2010 study in Public Opinion Quarterly found that in the 2008 election 25 percent of those who voted for Clinton in the Democratic primary ended up voting for Republican John McCain, rather than Barack Obama, in the general election.