As a North Charleston man accused of fondling a girl prepared to go to court, Circuit Judge J.C. Nicholson sought to arrange a guilty plea to avoid the trial altogether.

The man refused to take any deal, hoping instead to prove his innocence to a jury.

What followed was a proceeding that Venancio Diaz Perez's attorneys now say was fraught with the judge's flawed rulings that punished Perez for asserting his right to a trial. Perez was convicted of two charges and acquitted of the most serious crime. But Nicholson decided to stack his prison sentences, amounting to a decade more time than he had faced under the plea offer.

The argument is now being considered at the S.C. Supreme Court. Lower appeals judges already agreed that the sentence was vindictive and ordered a new penalty phase. But Perez, 50, wants a whole new trial.

"These are crimes that are abhorrent to all of us," one of Perez's appeals attorneys, Jason Luck of Charleston, told the high court during oral arguments late last year. "But that makes it doubly important to think carefully through this to make sure we are not guided by emotion but by the law.

"I have a great amount of respect for this judge, but we all have bad days sometimes."

Nicholson is widely known locally and respected by many jurists. The state's chief justice assigned him to oversee the unresolved murder case against Dylann Roof, the self-avowed white supremacist who killed nine black worshippers at Emanuel AME Church. Roof was recently sentenced to death in federal court.

When Perez's attorneys first brought up the accusation of retribution at the end of his 2013 trial, Nicholson took exception. He denied it, but did so with a statement that caused more concern.

Perez was convicted of lewd act on a minor and sentenced by Nicholson to 15 years in prison.

The judge tacked on a 10-year term under a conviction for assault and battery of a high and aggravated nature, and said the sentences should be served consecutively instead of at the same time.

The jury had found Perez not guilty of the more serious criminal sexual conduct charge, but Nicholson said he disagreed with that verdict.

"The (court is) of the opinion he's guilty of all the charges," he said, according to a trial transcript. "So it's not any abuse in giving him the consecutive (sentences)."

Perez already is eligible for parole. His appeal is likely to be decided in the coming weeks.

'Prior bad acts'

His attorneys offered the appeal as an opportunity for the state's top justices to clarify legal rules commonly employed in criminal trials.

Perez's wife often babysat children at their home. One of the children accused Perez of sexual acts. But social workers found no evidence of such abuse, and authorities refused to prosecute.

But another accusation emerged that landed Perez behind bars in July 2010. He stayed in jail until his January 2013 trial.

Discussions of a plea deal came in Nicholson's chambers. He suggested that Perez plead guilty to the lewd act, exposing the defendant to between 10 and 15 years in prison. In exchange, the judge said he would drop the other charge.

"I was talking to the two of you unofficially, off the record, trying to work out a plea," he would later tell prosecutors and defense lawyers.

The trial commenced with the prosecution's case relying on witness testimony instead of physical evidence. The victim and the child's mother testified.

Perez's past accuser and her mother also were allowed to take the stand over the defense team's objection.

In many criminal cases, court rules restrict evidence of a defendant's "prior bad acts," but it can be allowed when it shows a "common scheme" that helps define guilt in the present case.

Perez's attorney on the appeal contends that the judge essentially picked out similarities so that the two accusations matched up. Nicholson's decision allowing the past accuser's testimony could then allow the jury to infer guilt about the crimes Perez was being tried for.

Luck suggested that the Supreme Court give a "simple, clear explanation" for all judges to apply the rules in similar situations.

'A different ballgame'

But the problems with Perez's trial mounted, Luck said.

Both accusers' families were in the country illegally, and part of Perez's defense focused on how authorities offered them visas in exchange for testimony favorable to the prosecution. Meant specifically for crime victims, these "U visas" would help them avoid deportation.

The defense questioned the victim's mother about whether they were motivated to testify against Perez for the sake of staying in the U.S., but Nicholson shut down that line of inquiry with the past accuser.

That testimony and the defense team's lack of opportunity to challenge it serve as part of the foundation for the appeal. The Court of Appeals ruled that Nicholson should have permitted the questioning but that his error was harmless to the defense case.

Much of the argument centers on the judge's sentence — what Luck called a "symptom" of a larger problem with the trial.

When the case was argued Nov. 30 at the Supreme Court, some justices seemed hesitant to criticize the judge like the lower appeals court did. Justice John Kittredge asked whether a judge should be beholden to a sentence that had been rejected during plea negotiations out of fear of being labeled "vindictive."

"It’s a different ballgame in the end," Kittredge explained. "I’m just concerned we may throw the baby out with the bath water because an overwhelming majority of the time, more good comes from experienced trial judges helping to resolve cases."

But Justice Kaye Hearn noted that Nicholson essentially said Perez was guilty of all the charges despite a different finding by the jury.

"I think the trial judge became very upset when his impartiality was challenged," said Special Assistant Attorney General Amie Clifford, who argued the state's case on the appeal.

Despite Nicholson's statements, Justice Donald Beatty said he saw no evidence that the judge's sentence was a punishment for Perez going to trial.

"He did not attack," Beatty said of Nicholson. "He didn’t do anything he was not supposed to do."

Reach Andrew Knapp at 843-937-5414 or twitter.com/offlede.

Andrew Knapp is editor of the Quick Response Team, which covers crime, courts and breaking news. He previously worked as a reporter and copy editor at Florida Today, Newsday and Bangor (Maine) Daily News. He enjoys golf, weather and fatherhood.