A far-left Democrat who had the backing of groups allied with Bernie Sanders fell decisively in Wednesday’s Rhode Island Democratic gubernatorial primary, capping a bitter slugfest and marking the latest in a series of setbacks for fringe progressive groups seeking to take their views into the mainstream.

Incumbent Democratic Gov. Gina Raimondo, 47, easily brushed off an insurgent challenge from former secretary of state Matt Brown, 48, who refused to take money from corporate PACs and heavily courted Sanders voters in the state during the campaign.

Brown is backed by Justice Democrats, the political action committee started by organizers of Bernie Sanders’ failed 2016 presidential campaign, which has also backed come-from behind candidates including Alexandria Ocasio-Cortez in New York and Ayanna Pressley in Massachusetts.

He channeled Sanders’ rhetoric often, saying health care, housing, education and childcare cost too much and that he would work to build a different kind of economy that “works for everyone, not just for the few.”

But Raimondo, who had the endorsement of former Vice President Joe Biden, raised $7.6 million for her re-election bid in a state with just 1 million residents and a single media market.

ANALYSIS: SORRY, DEMOCRATIC SOCIALISTS — YOU’RE PUSHING POISON

Candidates inspired by Ocasio-Cortez, a Democratic socialist, and Sanders have been roundly defeated in several races nationally, even in heavily liberal districts that would seem most sympathetic to their ideology.

For example, in August, a fiscally conservative Democrat soundly defeated five other high-profile opponents to represent deep-blue Honolulu, including the architect of the state’s legal challenge to President Trump’s travel ban and a follower of Democrat socialist Alexandria Ocasio-Cortez.

FILE - In this Nov. 4, 2014, file photo, Republican candidate for Governor Allan Fung concedes defeat to Democrat Gina Raimondo in Warwick, R.I. Fung is seeking the Republican nomination in the Sept. 12, 2018 primary, to again run for governor. (AP Photo/Joe Giblin, File)

Pro-Trump candidate Allan Fung won the Republican nomination for Rhode Island governor.  (AP)

Sanders and Cortez-backed candidates have also faltered in Michigan, Missouri, and Kansas. But they have seen some successes, particularly in Pennsylvania, where four candidates who drew socialist support triumphed in primaries in May. But on the whole, Cortez — who pointedly did not receive former President Barack Obama’s endorsement for her own congressional bid — and Sanders have struggled to take their message mainstream.

SOCIALIST TORCHBEARERS FLAME OUT NATIONALLY, DESPITE HIGH-PROFILE SANDERS ENDORSEMENTS

On the Republican side, pro-Trump candidate Allan Fung won the Republican nomination for Rhode Island governor. The win gives Fung, the mayor of Cranston, a second chance at the office he failed to win four years ago in a contest against Raimondo. Fung beat Patricia Morgan, a state lawmaker.

Fung has given few interviews, held no press conferences and said little about his views during the race, as he walked the tightrope of being a pro-Trump Republican in a heavily liberal state. He says he wants to cut the sales tax from 7 percent to 5 percent, but he hasn’t put forward a detailed plan to pay for it.

In one of the few interviews he gave during the primary season, with The Providence Journal this month, Fung said he no longer supports a complete assault weapons ban. He also said he no longer describes himself as pro-choice, as he had in 2014. Trump lost Rhode Island by double-digits in the 2016 presidential race.

When asked whether he would support legislation to legalize abortion in the state, his wife, Barbara Ann Fenton, jumped in to answer. Fung agreed with her that it would depend on the bill.

Voters in Rhode Island on Wednesday also selected nominees for U.S. Senate, U.S. House, lieutenant governor and some key mayoral races.

In the Senate race, pro-Trump former Rhode Island Supreme Court Justice Robert Flanders won the Republican primary and will face Democratic incumbent Sen. Sheldon Whitehouse in November. Flanders beat California businessman Roque “Rocky” De La Fuente, who was running for Senate in numerous states.

Flanders, 69, has said he voted for Trump but that he would not reflexively back him. He has called Whitehouse “silver spoon Sheldon” and criticized his focus on climate change.

The 62-year-old Whitehouse is one of the leading voices in the Senate to do more to address climate change. He has also been harshly critical of President Donald Trump.

Also on Wednesday, Rep. James Langevin and his Republican opponent sailed through unopposed. Langevin is seeking a 10th term to represent the 2nd Congressional District in western Rhode Island. He’ll face Republican businessman Salvatore Caiozzo in November.

And Republican Patrick Donovan won his party’s nomination to challenge Democratic Rep. David Cicilline in November. Donovan, a stay-at-home father, beat accountant Frederick Wysocki in Wednesday’s primary.

The Associated Press contributed to this report.

Gregg Re is an editor for Fox News. Follow him on Twitter @gregg_re.