A Massachusetts man wanted in connection with a home invasion and shooting in York has turned himself in to police.

A felony arrest warrant was issued over the weekend for 27-year-old Nathaniel Rivera of Tyngsboro. Police allege he was involved in a home invasion and robbery early Saturday in York in which one man was shot.

Rivera turned himself in Tuesday with an attorney present, York police told the Lowell Sun. Rivera was held at York County Jail pending a bail hearing Wednesday in Springvale District Court.

On Monday, a gray Dodge Charger registered to Rivera was found in Lowell and towed to the Lowell Police Department. Police executed a search warrant that uncovered evidence related to the shooting, police told the Lowell Sun.

Rivera is charged with robbery, two counts of aggravated assault with a deadly weapon and burglary.

Police responded to a call shortly before 1:30 a.m. Saturday from a man who said he had been shot during a robbery. The victim told police that two men tried to rob him at his home and that multiple gunshots were fired at him. The victim said he escaped and ran to a neighbor’s house to call 911, police said.

The victim sustained non-life-threatening injuries after being shot in the lower leg and foot. He refused medical treatment at the scene, police said.

The victim’s truck was stolen during the incident but was later recovered by police.

Police said the robbery and shooting appeared to be an isolated incident and there is no danger to the general public.

Police are still working to identify two other men and two women who were at the residence at the time of the shooting.