About 24 hours after he was charged with misdemeanor assault, Republican Greg Gianforte was elected Thursday night to represent Montana in the House of Representatives.

Gianforte was projected to win the race at about midnight by Cook Political Report analyst Dave Wasserman and the Decision Desk. At the time of the call, his lead was roughly 10 percentage points.

Gianforte, 56, defeated Democrat Rob Quist in what once might have been considered an unexpectedly close special election for a House seat vacated by former Rep. Ryan Zinke (R-MT), now President Donald Trump’s interior secretary.

Gianforte will take office even after he allegedly body-slammed Guardian reporter Ben Jacobs, who was sent to the hospital for an X-ray on his elbow at a campaign event on Wednesday night. Gianforte won’t be the only member of Congress facing criminal charges, but the eleventh-hour assault charge appears to be without precedent in modern American politics, according to two congressional scholars.

Due to early voting in the state, close to two-thirds of ballots had been cast before news of the Jacobs assault even emerged. The story was widely covered in the Montana press, but it’s far from clear if it moved any votes.

At polling place in Bozeman, haven't found anyone yet who changed their mind bc of last night's events. #MTAL — Alexis Levinson (@alexis_levinson) May 25, 2017

While we don’t know the final margin, the victory also has Republicans nationwide breathing a sigh of relief. A Democratic upset in one of the most Republican-leaning seats in the country would have galvanized the minority party, boosted its recruitment efforts, and may have even stalled the GOP legislative agenda in Congress. Instead, in a third consecutive special election, Democrats came up just short.

Who were the candidates in Montana’s special election?

Even though the Montana race may have consequences for evaluating the national political landscape, the outcome may have been just as shaped by the personalities and personal eccentricities of the candidates themselves.

Quist is renowned at home as a founding member of the Mission Mountain Wood Band (M2WB). Attacked by his opponents as a “cowboy hat wearing hippie,” Quist praised Bernie Sanders, campaigned with the Vermont senator, and made affordable health care and defending public lands the centerpieces of his campaign. He’s well known in the state for his music, which led to headlines about “the poet” running for Congress and allows Quist to get away with campaign lines like, “I’ve really been representing Montana through my music and poetry all my life.”

More recently, Quist has come under a barrage of criticism for his personal financial history. In 2013, he was sued by Mission Mountain Wood Band bassist Steve Riddle for breach of contract. In May, the Associated Press revealed that Montana filed three tax liens to collect about $15,000 in back taxes from Quist. A subsequent AP report showed that he underreported his income by $57,000 — an embarrassment Republicans seized on immediately.

Quist’s opponent has had reams of bad headlines of his own. Gianforte was born in California, educated in Pennsylvania and New Jersey, and only came to Montana in 1995. After moving to Montana, Gianforte sued to try to keep people from being able to fish in a stream that ran by his property.

As the Huffington Post notes, Gianforte ran for governor and lost to Gov. Steve Bullock (D-MT) in 2016. In the process, he spent more than $5 million of his own money in a failed gubernatorial bid. That was good for airing 30,661 television ads — more than that of any other state candidate in history, a staggering figure in such a small state.

Gianforte’s career led Quist to seek inroads with voters by portraying his opponent as a corporate stooge. “The other choices we’re offered are really connected to corporate America, which in a lot of ways has undue influence on the politics of our country,” Quist told the Guardian. “My goal is to be a strong, independent voice for the people of Montana.”

And then there was the late-breaking news Wednesday that Gianforte had apparently attacked a reporter at a barbecue over a question about the Congressional Budget Office’s assessment of the impact of House Republicans’ health care bill.

None of that was apparently enough.

A close Montana race could bolster Democratic recruiting efforts

In 2016, House Democrats didn’t just face the obstacle of gerrymandering when going up against the GOP. They also ran a slew of extraordinarily weak candidates in red but achievable districts, including someone who had been unemployed for the past six years and a beekeeper with no elected experience.

Democrats hoped a Quist win would help change that. Victories in the special elections are seen as encouraging better Democratic candidates to throw their hats into the ring.

“If the general feeling is that it represents a warning sign for Republicans, that has strong implications for whether Democratic candidates jump in for 2018,” said Dave Hopkins, a Boston College political scientist, in an interview last week.

And the reverse effect also holds: If Republicans sense they’re in for a rough reelection bid, then vulnerable Republican incumbents will race toward the exits — creating more opportunities for House Democrats.

“There’s a self-fulfilling prophecy here, as incumbents consider retirement thinking they’ll face a tough race, which in turn makes the field tougher for Republicans,” Hopkins said.

Montana’s special election result suggest that Republicans can still win — and that may encourage vulnerable but formidable incumbents to try holding onto their seats.