A 19-year-old Baton Rouge man will serve 25 years in prison after pleading guilty to rape and burglary charges in a November 2011 attack on a 26-year-old woman in her Stanford Avenue apartment.

inside; he then pulled a knife and raped the woman, police saiState District Judge Lou Daniel ordered Thursday that Allan Hernandez’s prison term be served without benefit of parole, prosecutor Sue Bernie said Friday.

“She was very pleased. Now she can get on with the rest of her life,” Bernie said of the victim.

Hernandez pleaded guilty to charges of forcible rape and aggravated burglary.

The victim had just returned home at 3:15 a.m. on Nov. 29, 2011, when her attacker — later identified as Hernandez — approached, police have said.

As the woman was trying to get into her apartment, Hernandez asked her for a glass of water and if he could use the phone, police said. The woman refused and was trying to close her door when Hernandez forced his way d.

Police used DNA evidence to arrest Hernandez several days later, police said.