A North Philadelphia man who fired into a crowded Wawa in Bensalem in February, narrowly missing both his intended target and a group of bystanders, has been sentenced to six to 15 years in state prison, prosecutors said Tuesday.

Dascir Martin, 22, pleaded guilty to attempted murder, attempted aggravated assault, reckless endangerment of another person, and gun offenses during a hearing Monday before Bucks County President Judge Wallace H. Bateman.

His attorney, Deborah Weinman, did not return a request for comment.

Martin was arrested Feb. 19, not long after firing a 9mm handgun into the Wawa on Street Road near Kingston Way in Bensalem, according to the affidavit of probable cause for his arrest. Surveillance footage from the convenience store showed him walking about 10 feet away from its entrance, turning around, and firing through a window, the affidavit said.

He fled the scene but was arrested at a nearby Best Western hotel.

During an interview with police, Martin admitted to firing nine shots from the handgun, according to the affidavit. He said he was aiming at a customer inside the store he had gotten into an argument with moments earlier.