Lovelorn lawman Mark Brave is heading to mediation with the prosecutors in his felony theft case after the two sides failed to reach a plea deal.

Brave, the former Democratic Strafford County sheriff, is accused of stealing taxpayer money to fund extramarital liaisons. The scandal has so far cost Brave his marriage, his million-dollar Seacoast home, and his job. It could also put him behind bars for years.

Brave and prosecutors are at loggerheads over a possible plea agreement, including any incarceration, restitution, and fines. After the state made an offer to Brave and his attorney, Lief Becker, Brave countered with his own proposal. The state rejected Brave’s take on the deal.

Neither plea offer was available Tuesday.

Rockingham Superior Court Judge James Kennedy ordered Brave and prosecutors to try mediation to reach an acceptable plea agreement. Criminal mediation, also known as a felony settlement conference, typically involves a judge not connected to the case working with both sides to reach a consensus.

According to New Hampshire Judicial Branch Policy, cases suitable for felony settlement conferences involve defendants who admit wrongdoing. The conferences include input from the alleged crime victims as the judge guides all parties to a deal.

Failing a deal from the settlement conference, Brave will get a trial date for the eight felonies stemming from his alleged theft and coverup. If convicted, he could be sentenced to up to 64 years in prison.

Brave was a rising star in the New Hampshire Democratic Party as the state’s first elected African American sheriff when his illicit love life caught up with him. The formerly married Brave was using his government-issued credit card for plane tickets, hotel rooms, and expensive meals with at least three other women. At one point in the investigation, Brave was unable to name one of the women he was seen with, as he could not remember them all.

While under investigation last year, Brave publicly lashed out at the elected Strafford County commissioners, all Democrats, who he blamed for the scrutiny from the New Hampshire Attorney General’s Office. Brave even accused his fellow Democrats of being motivated by racism.

Brave’s troubles got worse after he was charged with stealing $19,000 in taxpayer money, perjury, and destruction of evidence. Under pressure from county officials, he agreed to go on paid administrative leave. The court also ordered him to continue living in New Hampshire pending trial.

But Brave lied to the court and prosecutors about his living arrangement and finances, according to court records. Brave hid the fact he cleared hundreds of thousands of dollars for himself selling his marital home in Dover for $1.5 million, and cried poor to get a free public defender, according to a report filed by prosecutors.

While he told the court he couldn’t afford a lawyer, Brave prepaid $50,000 for a year’s lease on an apartment in Massachusetts and bought a 1968 Porsche convertible, the state claims. Brave got around the court order to stay in New Hampshire by lying to the court and prosecutors and giving them the address of his now ex-wife’s Seacoast apartment.

Prosecutors moved to revoke Brave’s bail and threatened to hit him with new theft charges for illegally collecting more than $10,000 in salary as an elected New Hampshire official living out of state. Brave and Becker reached an agreement in December in which Brave finally resigned as sheriff in exchange for staying out of jail.