In tears and begging for mercy from a San Francisco judge, disgraced tech mogul Gurbaksh Chahal was led away in handcuffs Friday, ending a years-long legal battle in two domestic violence cases.

Chahal, 35, pleaded with Judge Tracie Brown to undo her decision two years ago to revoke his probation after he was accused of attacking a woman in 2016 at his Rincon Hill penthouse.

At the time of the attack, Chahal was on probation for beating another woman in the same penthouse a year earlier.

“The truth is, I’m not a bad person,” Chahal said while crying before being led away. “I’m begging you to have mercy on me, your honor, please.”

Chahal will spend the next six months in San Francisco County Jail after being sentenced to a year in jail on the probation violation charge.

Chahal’s lawyer, famous O.J. Simpson defense attorney Robert Shapiro, also asked the judge to reconsider her sentence.

“I don’t know anyone who has been punished more than he has in this case,” Shapiro said.

Brown refused to amend her sentence based on Chahal’s statement.

“I don’t think it demonstrates a great deal of regard for the victims in this case,” she said.

Walking outside the courtroom without his client, Shapiro said nothing to reporters.

“Mr. Chahal tried to escape consequences for his actions not once, but twice,” said Max Szabo, a spokesman for the district attorney’s office. “I think today he learned that wealth and privilege is not going to shield him from consequences.”

Chahal, a multimillionaire marketing tech mogul, was once named “America’s Most Eligible Bachelor” by the TV show Extra! His brushes with the law began in 2013, when he was arrested and charged with 47 counts of felony domestic violence for allegedly beating his girlfriend inside his high-rise penthouse at 301 Main St.

The beating was captured on Chahal’s personal security cameras, but a judge found police illegally seized the footage and suppressed the evidence. Chahal later pleaded guilty to two counts of misdemeanor domestic violence and was sentenced to probation.

While free on probation, prosecutors said Chahal attacked a 23-year-old woman in his apartment in 2014.

Brown revoked his probation in 2016, prompting Chahal to appeal the case all the way up to the state Supreme Court. He remained free while his case was under appeal. In mid-August, the court declined to hear his case.

“He’s been given every opportunity for a wake-up call,” said Beverly Upton, executive director of San Francisco’s Domestic Violence Consortium. “He still hasn’t gotten it. I think we’re a safer city today.”

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky