MARTINEZ — A failed 2018 candidate for Livermore mayor has been arrested and charged with writing a Facebook comment that allegedly threatened to burn down the home of a Contra Costa County judge.

Joshua Laine, 34, allegedly wrote the comment about superior court Judge Jill Fannin, who took it so seriously she requested police protection, prosecutors said. Laine was arrested and remains in jail; a judge denied a defense request to release him at a hearing Monday afternoon.

Contra Costa County Deputy District Attorney Jordan Sanders said in court Monday that Laine made the comment on a Facebook group called California Family Advocacy, which includes posts that accuse Contra Costa County judges of corruption. One post, according to Sanders, listed Fannin’s home address. Laine allegedly commented that “judges who violate the law get their houses burned down … just saying,” Sanders said.

The post could not be located as of Monday afternoon. The Facebook group has posted photos of judges with a pig’s snout photoshopped onto their faces, and accuses judges across the state of corruption, human trafficking and rigging the court system.

Fannin allegedly saw Laine’s comment, reported it to police and requested officers stay overnight outside her home. When police confronted Laine, he denied making the comment at first, then said he may have made it when he was drunk, then claimed it was a historical reference, not a threat, Sanders said in court Monday.

Laine’s attorney, Thomas Daly, said in court Monday that the comment was not a serious threat, and that Laine had no vendetta against Fannin as prosecutors allege. Fannin had never presided over legal cases involving Laine, who has sued other Contra Costa County judges in federal court and had family law cases in Alameda County, Daly said.

Fannin, the county’s presiding judge in 2017, was one of three judges targeted by a recall effort earlier this year, by a group that alleges rampant corruption throughout the family law court system. The group claimed in February to have enough petition signatures to recall one of the judges, Lois Haight, but never turned them in and accused the Contra Costa County elections agency of having illegal criteria for petitions.

During the Monday bail hearing, Daly argued that Laine could not afford a high bail and was eligible for a reduction under a recent state Supreme Court decision that says people shouldn’t stay in jail because of an inability to afford bond. He also said Laine was willing to comply with restrictions to his internet usage and go on GPS monitoring, should he be released.

Sanders argued Laine’s comments demonstrated a lack of respect for judges, indicating he was liable to ignore court orders and make another menacing comment. He said Laine faced serious felony charges and was at risk to flee the area, an accusation Daly contended was without merit.

Retired Judge Michael Nail, brought in to conduct the bail hearing after all judges in the county recused themselves from the case, said a $275,000 bail was “reasonable,” given the nature of the offense. His ruling means Laine will likely remain in jail at least until his next court hearing, set for July 23.

Laine ran for mayor last year, saying in interviews he wanted to curb government overspending, lower taxes and expose “abuse” in local government. He also briefly ran for California governor in 2018, according to the nonprofit Ballotpedia, which tracks elections.

“I would like to implement greener resources and reduce costs and costs of living for Livermorians,” Laine wrote in his mayoral candidate statement. “I am a devout supporter of citizens’ rights first and government accountability.”

Laine received roughly 7,000 votes, or 22 percent, and lost the election to incumbent John Marchand.

Laine is a former U.S. Marine, who was honorably discharged in 2007, according to his candidate statement. In recent years, he has undertaken beer brewing and winemaking business ventures, with a focus on aiding other military vets through employment and donations.