A Pennsylvania man who repeatedly stabbed a woman in an Atlantic City casino parking garage last year and then locked her in his car before she eventually escaped from the moving vehicle has pleaded guilty to attempted murder.

David Legette, 54, of Bristol, entered his plea Tuesday as part of a deal with Atlantic County prosecutors. It was made public on Wednesday.

Legette now faces a 16-year state prison term when he's sentenced July 20.

The Pennsylvania woman had an active restraining order against Legette when the attack occurred on July 2, prosecutors said, adding that the pair had previously been involved in a romantic relationship.

While they were in the garage, Legette pulled out a knife and stabbed her 19 times. He then locked her inside the car, using the vehicle's child-lock feature to make sure she couldn't escape.

As Legette drove in nearby Ventnor a short time later, the woman reached out of the window and opened the door from the outside, prosecutors said. She then rolled herself out of the car and landed in the middle of the road as Legette drove off.

Witnesses saw the woman escape and quickly called 911 as Legette sped away from the scene. The woman identified Legette as her attacker to officers at the scene. He was located and arrested in Bristol on July 2 of last year, and prosecutors said the victim's DNA was found inside the vehicle.

The woman survived the ordeal. Besides the numerous stab wounds, she also suffered a partially eviscerated intestine and a lacerated liver and spleen.