After several twists and about-faces, the murder case against Stephen Headley effectively ended Tuesday when he agreed to accept a potential 50-year prison term for fatally stabbing a South Jersey woman two years ago.

Flanked by family and friends of Nicole Ayres, 22, an ace high school and college softball pitcher, the Southampton man calmly pleaded guilty to the Sept. 13, 2010, attack and told a judge he understood he likely would serve at least 421/2 years without parole.

Counting time served, Headley, 30, would be over 70 before he could be released. Ayres' family members had hoped he would be locked up forever but said they were satisfied.

"I would have liked a life sentence, but my main concern is that he never gets out. . . . We're hoping he'll die in prison," said Richard Ayres, the victim's father. "If he gets one day free, that wouldn't be right for Nicole."

The family marshaled the support of an online community of victims' rights advocates after state Superior Court Judge James W. Palmer Jr. said in June that he would sentence Headley to 30 years without parole, the minimum for murder, in return for a guilty plea. It gathered more than 6,000 online signatures and submitted petitions to the judge.

Headley took the judge's offer, but the Burlington County Prosecutor's Office filed a brief saying he should get a life sentence. Headley previously was convicted for fondling an 11-year-old girl and was accused of a "particularly brutal" crime in which he stabbed Ayres 36 times, the prosecutor said.

Shortly before Palmer was to sentence Headley last month, the judge changed his mind, saying he had the opportunity to review the case more fully. That opened the door for new negotiations or a trial.

Assistant Prosecutor John Brennan said in recent weeks that his office wanted nothing short of a life sentence. After Tuesday's hearing, Brennan said the sentence was "for all intents and purposes . . . very close to a life sentence. . . . It's foolish to litigate when you don't have to."

Cedric Edwards, Headley's public defender, said his client "wants to get this thing behind him. He recognizes what he did was wrong. . . . He looks very stoic but he's been extremely remorseful when he talks about this to me."

Earlier, Edwards said that he believed the family's efforts had put pressure on the judge.

During the hearing, Headley, whose hands and feet were shackled, looked down and answered each of Edwards' questions with a simple "yes." His answers placed him at the murder scene, where he stabbed Ayres with his pocket knife, a crime he later confessed to his grandmother.

Authorities said Headley and Ayres were acquaintances and got into an argument after they went to a desolate soccer field in Southampton shortly after midnight.

Ayres, of Westville, was an All-South Jersey athlete at Deptford High School and Atlantic 10 Rookie of the Year in 2007 at Fordham University.

After the hearing, Headley's mother, Cammy, said that during a visit with her son at the Burlington County Jail, she had warned him that he could get life imprisonment if the case went to trial. She said he told her Ayres had grabbed his knife during the argument and cut him on the finger, and that's when he "blacked out."

Cammy Headley expressed sympathy for the Ayres family. But, she said, her son has a learning disability that could have affected his behavior. He is "not a monster," she said.

Sentencing is scheduled for 1:30 p.m. Jan. 2.