Updated

A northern Virginia man pleaded guilty Wednesday to raping and killing a Muslim teenager last year in a case that drew national attention for its brutality on a young victim who had been walking with friends to early-morning religious services.

The plea deal allows Darwin Martinez-Torres, 25, of Sterling to avoid a potential death penalty for the June 2017 murder of 17-year-old Nabra Hassanen of Reston.

She had been out with a group of friends eating a pre-dawn meal at a fast-food restaurant ahead of Ramadan services. Martinez-Torres was driving by and got into an altercation with the group.

Wednesday's plea deal will mean Martinez-Torres gets life without parole when he is formally sentenced in March.

Nabra's death attracted widespread attention, and thousands of mourners attended her funeral. There were concerns that her slaying was motivated by anti-Muslim sentiment, but police have said repeatedly they have no evidence of a hate crime.

Instead, police called it an incident of road rage.

In court Wednesday, prosecutor Casey Lingan said the attack began when Martinez-Torres drove by and honked his horn at one of Nabra's friends who had been riding his bicycle in the road as they walked back to their mosque. The friend yelled back at Martinez-Torres, who started chasing the group, first in his car and then on foot.

Lingan said Nabra, who was wearing sandals, couldn't run as fast the others, and Martinez-Torres caught up with her, wielding a baseball bat. A friend of Nabra's described hearing a "thud and a metal ping" when she looked back. Some friends started to go back to help Nabra, but Lingan said Martinez-Torres scared them off with his bat.

Martinez-Torres, a native of El Salvador who federal immigration authorities have said is in the country illegally, was caught shortly after the attack. He initially denied attacking Nabra but quickly confessed under questioning from detectives. He told them that he "got out of control" and that after he first struck Nabra with the bat he "just kept thinking ugly things."

He raped her while she lay unconscious and dumped her body in a pond.

Fairfax County Commonwealth's Attorney Raymond Morrogh brought capital murder charges last year, and said he only agreed to take the death penalty off the table in Wednesday's plea after consulting with the family, which indicated it would be satisfied with a life sentence.

Martinez-Torres' lawyer, Joseph Flood, said his client has intellectual disabilities, and that his IQ is below 68. Morrogh acknowledged that if evidence of a severe intellectual disability were confirmed by an independent examiner, Martinez-Torres may well have been ineligible for a death sentence.

The plea deal carries an unusual provision that requires Martinez-Torres to answer any questions posed of him by the victim's family over the next year. Nabra's father, Mahmoud Hassanen, has been outspoken about his concerns that Nabra's death may have been a hate crime. Gadeir Abbas, a lawyer with the Council on American-Islamic Relations, which provided legal assistance to the Hassanen family, said the provision is in place to allow the family to ask Martinez-Torres directly why he killed her.

Morrogh said after the hearing that he has only rarely included such a provision in a plea agreement, and he did so in this case because he understood the Hassanen family's bewilderment at what could motivate such a crime.

"This is just such a random crime on such a loving, young person practicing her religion," Morrogh said . "I hope something comes out of that part of the agreement."

Nabra's father fought back tears after the hearing and said he considers Nabra "to be a martyr in the eyes of God."