A Palmyra man has been arrested on charges that he attacked man at gunpoint, robbed him and nearly had the man “dig his own grave.”

Matthew Flood, 31, was arrested Wednesday and charged with aggravated assault, robbery, and possession of a firearm by a convicted felon.

The Somerset County Sheriff’s Office, which made the arrest, said in a news release Thursday that the charges stemmed from an incident on Jan. 21, when Deputy Stephen Armiger was stopped by the side of the road in his patrol vehicle by a 63-year-old man driving by. The man reported Flood had attacked him on Webb Road in Palmyra and the victim was driving himself to the hospital.

The man told police he had been contacted by a woman who was his acquaintance, and that she asked him for a ride so she could leave Flood’s residence. The man said when he arrived, Flood attacked him, kicked him to the ground and snatched a loaded pistol from the fallen man’s belt, according to the release.

“Flood then began to pistol whip the victim about the head,” the release said. “Flood, while holding the man at gunpoint, then ordered the man to empty his pockets and took possession of a small amount of cash, a knife and cellphone that the victim had.”

Police said Flood tried to get the man to go behind the residence to “dig his own grave,” but the man convinced Flood to let him leave.

The man suffered severe injuries to his head, chest and ribs, including a nearly severed ear and several broken ribs, police said.

The sheriff’s office said the case was turned over to its Criminal Investigation Unit at the Sheriff’s Office, where Detective Jeremy Leal found and interviewed witnesses and confirmed that Flood is a convicted felon.

Flood is being held at the Somerset County Jail in East Madison in lieu of $50,000 cash bail and is scheduled to make an initial court appearance Friday.