Historically speaking, campaigning while out on bail on felony charges has proved to be a surefire way to lose an election, with some notable exceptions.

But this campaign cycle, felony indictments appeared little more damaging than TV attack ads as three Republican candidates facing an assortment of fraud charges appeared to squeak past their Democratic opponents to hang on to their seats Tuesday night.

They include Rep. Duncan D. Hunter (R-Calif.), indicted on federal charges of wire fraud and accusations he funded a luxurious lifestyle with campaign donations; Rep. Chris Collins (R-N.Y.), indicted on federal insider trading charges; and Texas Attorney General Ken Paxton (R), indicted on felony securities fraud charges in state court, accused of lying to friends and potential investors about his financial stake in a tech company.

Although Collins’s challenger, Democrat Nate McMurray, conceded to Collins on Tuesday, he demanded a recount early Wednesday morning after the vote tally showed him trailing Collins by just one percentage point. Wednesday afternoon, the Associated Press projected that Hunter had defeated Democratic challenger Ammar Campa-Najjar. Paxton, who has managed to delay his trial on securities fraud charges three times since being indicted in July 2015, won by four percentage points. It was an unusually tight race in a state where Republican statewide officeholders have consistently crushed Democratic challengers by 20 points or more for the last two decades.

Despite the close races in solid-red territory, their apparent victories highlight the polarizing political climate in which criminal investigations into elected officials are frequently met with more sympathy among supporters than scorn.

All three candidates have denied wrongdoing and characterized the indictments against them as politically motivated “witch hunts,” as their Democratic opponents have lunged at every opportunity to remind voters that jail time could be in their futures.

“Republicans, Democrats and independents know that it’s time to put country before party and reject a Congressman who’s out on bail,” McMurray said in an Oct. 29 statement.

“If Paxton can’t follow the law, how can he enforce it?” read an ad from Paxton’s challenger, Justin Nelson.

None of it seemed to work.

While it’s neither unprecedented or unlawful for indicted candidates to win seats in Congress or state office, it’s surely a rare feat.

Michael Grimm, former Republican congressman from New York, achieved it in 2014 after he won his reelection bid despite facing federal indictment for tax fraud related to a restaurant he owned, where authorities alleged he paid undocumented immigrants off the books. One month later, he pleaded guilty to a single tax evasion count — but at first refused to resign. When a judge sentenced him to eight months in prison in 2015, she told him his “moral compass, Mr. Grimm, needs some reorientation.” Grimm ultimately resigned from Congress.

Before that there was Floyd Flake, the former Democratic congressman also from New York, who with his wife was indicted on a charge of allegedly embezzling funds from the African Methodist Episcopal Church where he was a pastor. He won another term in 1990 despite the charges, which were later dropped.

William J. Jefferson, a Democrat from Louisiana, is perhaps an honorary member of the club: In 2006, he won a bid for reelection just several months after federal investigators found $90,000 in bribe money stuffed in cardboard food packages inside his freezer. He was indicted in 2007 while in office. In the 2008 campaign, Republican Joseph Cao defeated him to become the first non-Democrat to take the seat in that district since 1890. Jefferson was convicted and served a prison sentence.

Losses at the polls or swift resignation have been the more typical consequences for most indicted candidates over the last several decades, a non-comprehensive list of whom was compiled recently in the Buffalo News, the leading paper in Collins’s district.

But not so for this year’s group.

Post-indictment campaign tactics for both Hunter and Collins turned particularly vile after both candidates released attack ads targeting their opponents, which were quickly denounced as racist.

Hunter, who was accused in August of siphoning campaign funds to pay for everything from tequila shots to trips to Italy and SeaWorld, released an ad painting Campa-Najjar, a Palestinian Mexican American raised Christian by his mother in San Diego, as a terrorist sympathizer and “security risk” seeking to “infiltrate Congress” with support from the Muslim Brotherhood.

Collins, meanwhile, released an ad featuring McMurray’s wife, a naturalized U.S. citizen from Korea, who was seen speaking Korean while the ad suggested McMurray wants “fewer jobs for us . . . more jobs for China and Korea.” Later, Kim Jong Un, the North Korean dictator, makes a cameo while the ad claims McMurray “helped American companies hire foreign workers.”

Collins, who served as chairman of a pharmaceutical company called Innate Immunotherapeutics, is accused of tipping off his son after a high-stakes drug trial failed, allowing his son and other family members to avoid more than $700,000 in losses. He had originally suspended his reelection campaign following the indictment. But he relaunched it the next month, maintaining his innocence.

If convicted, Collins faces between five and 20 years in prison. Hunter faces between 21 months and five years, and Paxton faces between five to 99 years.

Some candidates have tried to run for reelection while in prison. That, too, has not always panned out well.