VISTA, California — Former NFL player Kellen Winslow Jr. pleaded guilty Monday to raping an unconscious teen and sexual battery involving a 54-year-old hitchhiker.

Winslow entered the pleas as he was about to be retried on two rape allegations in San Diego County Superior Court.

In exchange for his plea, the court agreed to sentence him to between 12 and 18 years in prison. He had faced life in prison if convicted of rape on multiple counts in the retrial.

RELATED: Jury finds former Browns TE Kellen Winslow II guilty on 1 rape charge, judge declares mistrial on remaining 8 charges

In June, a jury found him guilty of raping a homeless woman in Encinitas, north of San Diego. Jurors also convicted him of two misdemeanors — indecent exposure and a lewd act in public — involving two other women.

But that jury failed to agree on other charges, including the alleged rape of the hitchhiker and the rape of the unconscious teen in 2003. Under the plea deal, the attack on the hitchhiker was reduced to sexual battery.

The 36-year-old former tight end — at one point one of the highest-paid in the NFL — had previously pleaded not guilty to the undecided charges. His attorney, Gretchen von Helms, had said the sex was consensual.

Five women took the witness stand this summer, and three of them were expected to testify again.

RELATED: Closing arguments given in rape trial of former Browns TE Kellen Winslow Jr.

Defense attorneys attacked the credibility of the five women and pointed out inconsistencies in their stories in the first trial.

The court had planned to allow the new jury to hear that Winslow was convicted of raping the homeless woman, who would have been among those testifying again.

Jurors would also have been told about the indecent exposure conviction, though that woman was not expected to take the stand.

Winslow, who played for Cleveland, Tampa Bay, New England and the New York Jets, earned more than $40 million over 10 seasons in the NFL. He is the son of Chargers Hall of Fame receiver Kellen Winslow, who was in the courtroom throughout the first trial.

Kellen Winslow II_1528509952656.png.jpg
Tight end Kellen Winslow #80 of the Cleveland Browns jogs on the field against the Cincinnati Bengals at Cleveland Browns Stadium on November 26, 2006 in Cleveland, Ohio. The Bengals defeated the Browns 30-0.
Gregory Shamus/Getty Images

The defendant did not testify at his first trial.

RELATED: First accuser testifies at Kellen Winslow Jr's rape trial