A 28-year-old homeless man has been charged with sexually assaulting two women in New Jersey after threatening with a knife to hurt them if they resisted, prosecutors said Tuesday.

Shawn Midgette, who is known to stay in the Willingboro area, was taken into custody Monday by Willingboro police at a McDonald’s restaurant on Beverly Rancocas Road, authorities said. The knife believed to have been used during the assaults was found on him, they said.

The first assault occurred Friday in Willingboro and the second on Saturday in Mount Holly, the Burlington County Prosecutor’s Office said.

On Friday, Midgette allegedly approached a 79-year-old woman after she left a pharmacy on the 100 block of Springside Road in Westampton Township, then forced her to drive him to the Garfield East section of Willingboro. He allegedly sexually assaulted her in her vehicle and took cash from her purse before fleeing on foot, prosecutors said.

Midgette was immediately identified as a suspect, and police began searching for him, including checking out area homeless shelters, prosecutors said.

Then, on Saturday, Mount Holly police were contacted by a 58-year-old homeless woman, an acquaintance of Midgette, who said he threatened her with a knife and sexually assaulted her about 10:30 that night in Monroe Park, authorities said.

After being located, Midgette was charged Monday night with two counts of aggravated sexual assault, robbery, possession of a weapon, and related offenses. He was in custody at the Burlington County Detention Center and will face a detention hearing in the near future, prosecutors said.

He did not yet have an attorney Tuesday.