John Hart apologized Thursday - but only for his past behavior toward a Philadelphia judge.

And he said he's learned from his conviction for stalking and sending threatening text messages to former CBS3 anchor Erika von Tiehl after she broke up with him in 2011. But those lessons, he told Judge Gwendolyn N. Bright, were largely related to how "lucky and truly blessed I am" to have supportive family and friends.

Hart, speaking in a Philadelphia courtroom during his sentencing hearing, had little to say about his crimes and the impact they had on von Tiehl, saying simply that he wanted to "focus on the future and the ways I can be a better person."

"I look forward to living a life of tranquility," he said.

That journey will start in prison.

Hart, 39, of Havertown, was sentenced Thursday to 21/2 to five years in prison for his crimes against the onetime news anchor.

Bright, in imposing a stiffer-than-normal sentence for Hart's counts, said she did so because of his history of convictions for harassing other women. His record included 11 arrests, she said, although she did not go into detail about each one.

The judge also noted that Hart was intelligent and surrounded by well-intentioned supporters, but showed "a completely different face" around many women.

"You do what you want . . . and it's got to stop," she said. "A lot of the time you've spent in custody has been the result of being your own enemy."

Hart, a former law student who initially represented himself in the case, sat quietly as the sentence was imposed - a departure from his behavior during the rest of the hour-long hearing, when he frequently whispered to his attorney, Jack McMahon, and bristled at discussions about his former run-ins with the law.

Hart also admitted to Bright on Thursday that he often had acted out-of-line toward her while serving as his own attorney, and he apologized for his conduct.

McMahon called the sentence "fair," and said "hopefully John will learn from this and have a productive life."

Assistant District Attorney Lauren Katona, who sought a prison sentence of up to seven years, said after the hearing that she was "glad the court imposed a sentence that reflects the serious nature" of Hart's actions.

Hart briefly dated von Tiehl after they met on Facebook in 2011. When she tried to end the relationship, he sent her anonymous threatening text messages, including a threat to harm her career by revealing secrets about her to the Daily News. He was convicted in November of stalking and harassment.

He also was acquitted on four counts: identity theft, two counts of using computers to disrupt communications services, and possession of an instrument of crime (his cellphone and computer).

Hart has been jailed since his arrest in 2011. Last month, von Tiehl, asking that Hart receive "just punishment" for his actions, testified that she was "so grateful for every day he has spent behind bars."

Von Tiehl, who has since married and left CBS3, was not in the courtroom Thursday and could not be reached for comment.

It was not immediately clear how long Hart would remain in prison. Bright said she would credit Hart for the three-plus years he's already served, but only for the time that could be explicitly tied to this case. Hart also was being held for violating his probation in other cases, the judge noted.

One of those violations resulted from breaking probation relating to a 2006 case. In that case, in Delaware County, Hart pleaded guilty to simple assault and stalking and received 18 to 48 months in prison, court records show.

In addition to his prison sentence Thursday, Hart was sentenced to two years' probation and a $1,500 fine.

215-854-2817 @cs_palmer