HIGHLAND PARK — The man who was accused of forcing a woman into of an apartment building before sexually assaulting and beating her has pleaded guilty to charges from the February incident.

Middlesex County Prosecutor Andrew C. Carey announced on Tuesday that 23-year-old Brandon Cox agreed to plead guilty to kidnapping and aggravated sexual assault for the Feb. 19 attack.

At the time of his arrest, Carey said Cox had a gun shown when he approached the woman who was walking with a child. Before police could respond Carey said Cox fled the scene before being arrested after an "intensive investigation."

As part of the plea deal Cox, will be sentenced to 23 years in prison, and will have to serve at least 85 percent, or more than 19 years of his sentence before he is eligible for parole. Cox will also be required to register as a sex offender under Megan's Law and undergo lifetime parole supervision. Sentencing is scheduled for Oct. 16.

The Franklin man was previously incarcerated after being charged with kidnapping and attempted murder in 2014. He served more than a year as a result of that case when he was accused of forcing a 14-year-old to have sex with him four times between March 2013 and April 2014.

More From New Jersey 101.5

Dan Alexander Contributed to this report

Contact reporter Adam Hochron at 609-359-5326 or Adam.Hochron@townsquaremedia.com

More From Beach Radio