Updated

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. Raimondo was leading Brown by more than 20 percentage points Wednesday night, 56 to 34 percent, with almost all precincts reporting.

Raimondo's win sets up a rematch with pro-Trump Republican mayor Allan Fung, who came in just 4.5 points behind Raimondo in a three-way race in 2014.

Brown was backed by Justice Democrats, the political action committee started by organizers of Bernie Sanders' failed 2016 presidential campaign, which also had 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. She made the case for a second term by highlighting the state's improving economic fortunes, including a falling unemployment rate, as well as new job training programs and free community college tuition started during her tenure.

The campaign was nasty, with both sides hammering each other for months. Brown went after Raimondo's corporate ties, while Raimondo compared Brown to Trump, calling him a "financial disaster" over how he managed his failed 2006 campaign for U.S. Senate and the nuclear non-proliferation group he co-founded, Global Zero. Brown had a lawyer threaten to sue her for defamation this month. Raimondo refused to debate him.

ANALYSIS: SORRY, DEMOCRATIC SOCIALISTS -- YOU'RE PUSHING POISON

fung

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

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

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

Candidates backed by Sanders or Ocasio-Cortez also have 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. However, on the whole, Ocasio-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, Fung, the mayor of Cranston, has 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, by double digits.

Fung has given few interviews, held no news 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's said he wants to cut the sales tax from 7 percent to 5 percent, but hasn't put forward a detailed plan to pay for it.

Although Trump lost Rhode Island by double-digits in the 2016 presidential race, Fung has praised Trump's "track record," saying that "the president is doing a good job in the economy, but I act in my own way." He also has backed the White House's broad immigration policies.

"We will not be a sanctuary state, and I will fight against sanctuary cities like Providence."

— Rhode Island GOP gubernatorial nominee Allan Fung

"Unfortunately, under Gov. Raimondo, Rhode Island had the highest murder rate in the region in 2016," Fung said in a release. "When I’m governor, we will not be protecting criminals who are in this country illegally, period. ... We will not be a sanctuary state, and I will fight against sanctuary cities like Providence."

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 ban on "assault weapons." He also said he no longer describes himself as pro-choice, as he had in 2014. And, 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 is set to 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 also has been harshly critical of 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's set to 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.

Fox News' Kaitlyn Schallhorn and The Associated Press contributed to this report.