Republican Greg Gianforte overcame an election eve assault charge filed against him that sparked national attention, defeating Democrat Rob Quist in the race for Montana’s open U.S. House seat Thursday.

Gianforte received 50.2 percent to Quist’s 44.1 percent. Libertarian Mark Wicks picked up 5.7 percent of the vote.

The result is a major disappointment for progressive activists who poured money into the campaign to help Quist, a banjo-playing songwriter and political newcomer, in a bid to notch a symbolically important win against President Donald Trump.

“Your voices were definitely heard in this election,” Quist told supporters after the results were final. “I know we came up short, but the energy in the state and the grassroots movement in the state goes on.”

The defeat is especially demoralizing for Democrats in light of the misdemeanor assault charge against Gianforte, a multimillionaire tech entrepreneur and social conservative, for allegedly “body slamming” Ben Jacobs of The Guardian on Wednesday while the reporter was asking about the GOP health care bill. Gianforte’s campaign blamed Jacobs, casting him as a “liberal reporter” who acted “aggressively” toward the Republican as he was about to be interviewed by a TV crew. But Alicia Acuna, the Fox News reporter who was slated to interview Gianforte, corroborated Jacobs’ version of events, and the incident spurred widespread condemnation of the Republican.

“Last night I made a mistake,” Gianforte said in his victory speech Thursday night. “I should not have responded in the way that I did, and for that I’m sorry.”

The Democratic Congressional Campaign Committee and the liberal group MoveOn.org had blasted Gianforte with a last-minute ad campaign highlighting the incident as evidence he was “unfit to serve” and had “no business being in Congress.”

House Speaker Paul Ryan (R-Wis.) urged Gianforte to apologize earlier Thursday and called his behavior “wrong.” And three Montana newspapers withdrew their endorsement of him.

The Missoulian newspaper said “there is no doubt that Gianforte committed an act of terrible judgment that, if it doesn’t land him in jail, also shouldn’t land him in the U.S. House of Representatives.”

A factor likely benefiting Gianforte was that before news broke of Wednesday’s altercation, more than two-thirds of those who voted in the election had already cast early ballots, according to state election officials. Still, Quist’s loss will inevitably fuel criticism that the national Democratic Party got involved in the race too late.

Even before Thursday’s results were known, Jeff Hauser, a veteran progressive political strategist at the Center for Economic and Policy Research’s Revolving Door Project, had told HuffPost that “the national Democrats who provided financial assistance after mail-in voting had already begun will have to question anew their initial reluctance to engage in the race in March and early April.”

“Early funding might have ensured more consistent tracking on Gianforte,” Hauser added, referring to the attack on the reporter. “It almost seems like you never know when Gianforte might commit a crime under a modicum of scrutiny.”

Under almost any circumstances, a Democratic win would have been an upset. Even as Quist’s standing improved in the campaign’s final weeks, none of the polls released in advance of the race showed him ahead of Gianforte.

Montana’s at-large U.S. House seat opened up in December when Trump tapped Ryan Zinke as his interior secretary. Republican Zinke had cruised to re-election in November by nearly 16 percentage points. Trump carried the state over Democratic rival Hillary Clinton by 20 points.

Democratic presidential candidates have triumphed in the state just twice since 1952, most recently when Bill Clinton won it in 1992.

Still, in a state with a sizable segment of independents, Democrats at times have held their own in down-ballot races. One of them is current Gov. Steve Bullock, who won re-election in 2016 when he defeated Gianforte by 4 percentage points.

Quist, 69, a native-born rancher’s son from the Flathead Valley and founder of the popular Mission Mountain Wood Band, had the profile to repeat Bullock’s success. But Montana’s GOP leanings proved insurmountable in a traditionally low-turnout special election.

“When this race started, I thought Quist had a 1-in-5 chance,” Jorge Quintana, a Democratic National Committee member from Montana, told HuffPost. “I don’t think any Democrat has been disappointed with the way Quist has behaved in this campaign. He has raised a ton of money. And he has hit the state hard ― Montanans expect that.”

Justin Sullivan/Getty Images Montana Democrat Rob Quist speaks to supporters earlier this week in Great Falls. His hard-fought House campaign fell short of victory on Thursday.

With grassroots opposition to Trump prompting a wellspring of national protests and small-dollar fundraising for progressive causes, Democratic leaders looked for a victory in Montana to signal waning public support for the president in historically Republican territory ― and spook GOP leaders.

But Quist’s loss comes on the heels of similar disappointments for the party. Earlier this month in Omaha, Democrat Heath Mello failed to unseat Republican Mayor Jean Stothert. In April, progressive Democrat James Thompson lost an unexpectedly close race for an open House seat in deep-red Kansas.

In 2017’s highest-profile race, Democrat Jon Ossoff fell less than two percentage points short in April of an outright win in Georgia’s 6th Congressional District, a seat Republican Tom Price gave up to become Health and Human Services Department secretary and that former House Speaker Newt Gingrich once held. Ossoff faces Republican Karen Handel in a June 20 runoff election.

Democrats were able to flip two state legislative seats on Tuesday ― one in New York, the other in New Hampshire.

Quist, known throughout sprawling Montana for his music and poetry, barnstormed across the Treasure State in what at first seemed a quixotic campaign. He encouraged supporters to organize new Democratic committees in counties long neglected by the party. Until late last month, the Democratic Congressional Campaign Committee virtually ignored the race.

Quist was buoyed by support from Sen. Bernie Sanders (I-Vt.), who Quist backed in the 2016 Democratic presidential campaign. Sanders, who won Montana’s primary over Clinton, headlined four separate campaign events for Quist this past weekend that drew thousands of supporters.

Gianforte sought to capitalize on Trump’s popularity in the state. Donald Trump Jr. and Vice President Mike Pence campaigned on his behalf. Both the president and Pence recorded a last-minute robocalls for him.

Still, Quist’s campaign gained ground as House Republicans passed the deeply unpopular healthcare bill and the White House became engulfed in a series of self-inflicted scandals. Party leaders tripled their initial investment in the race to $600,000 as polls showed it tightening earlier this month.

Quist raised more than $5 million, with his average individual donation amounting to $25 ― $2 below the figure that Sanders’ constantly touted during his presidential run. Quist received more than $550,000 after Gianforte waffled on his support for the American Health Care Act that would repeal and replace Obamacare.

The 56-year-old Republican praised the bill, which threatens the health insurance coverage for at least 70,000 Montanans, in a private call to conservative lobbyists. Days later, Gianforte walked back his comments amid voter outrage after The New York Times earlier this month published audio of the call.

Quist, whose medical expenses nearly bankrupted him in the 1990s after a botched surgery left him unqualified for affordable health insurance, hammered his opponent with slogans like “hands off our health care.”

Quist also depicted Gianforte, who sold a software company in 2011 to tech giant Oracle for $1.5 billion, as an out-of-touch millionaire guy from outside the state. The cowboy hat-clad son of Montana ranchers repeatedly skewered Gianforte as a “New Jersey billionaire.” The Republican, born in San Diego, spent years in the Garden State before moving to Montana in 1995. His reported net worth is estimated at between $65 million and $315 million.

Gianforte raised more than $3.4 million, including a $1 million loan he made to his campaign.

Republicans attacked Quist for failing to pay commercial taxes on a barn he converted in the 1990s into a concert space and rental property. Quist defended the property in an interview with the Billings Gazette, insisting his son lived there, “so that’s not a rental property. It’s just something that’s kind of family-owned.”

A lengthy report in the conservative Washington Free Beacon cast doubt over the botched gallbladder surgery Quist frequently cited as the pre-existing condition that prevented him from getting health insurance.

Quist’s loss may heighten Democratic concerns about the re-election prospects next year for Sen. Jon Tester, a party moderate.

Quintana, though, said he believes Tester is in good shape for a third term.

“He looks out for Montana. He’s setting himself up quite nicely for 2018,” Quintana said.