A Las Vegas man whom authorities feared as a potential serial killer — shooting four men, two fatally — was arrested in connection to the senseless killings, authorities announced Tuesday.

Joshua Emmanuel Castellon, 26 — who was collared Friday — faces a slew of charges that include murder and attempted murder for the shooting spree between Jan. 29 and Feb. 2 that targeted random homeless people sleeping on the street.

“[The] good news is we have a suspect in custody, and we’re relieved that a dangerous person is off the streets,” Metropolitan Police Department Homicide Capt. Robert Plummer told reporters, according to the Las Vegas Review-Journal.

A cop in Las Vegas questioned Castellon on Feb. 8 after spotting him sleeping outside an apartment building, according to a federal complaint cited by the newspaper. Six days later, investigators were convinced they had their suspect and “then everything started coming together,” Metro Homicide Lt. Dan McGrath said.

Investigators have no motive for the shootings and have yet to connect Castellon to any other killings, but McGrath said investigators are still trying to determine if he ever traveled out of the area.

“We’re pretty sure that gun hasn’t been used in another shooting,” McGrath said, according to the Los Angeles Times. “But I can’t definitively say he has not done something similar here — most likely it would be here, but it could be out of state.”

Castellon — who identified himself as a driver for Lyft, according to a federal criminal complaint — was taken into custody after his estranged wife told police she confronted him about the killings following media coverage of the shootings. Castellon denied being involved but agreed to a formal interview a few days later when stopped by officers. He told detectives he bought a revolver in hopes of reselling it to a “friend of a friend,” according to the complaint. Investigators have yet to recover the handgun they believe was used in all four shootings.

Castellon’s estranged wife declined comment when reached Tuesday by the Review-Journal.

McGrath said tips from the public and the release of surveillance video of Castellon’s Hyundai Tucson — which police said he had been sleeping in at times, although he wasn’t homeless — led to the arrest.

Las Vegas police Capt. Robert Plummer characterized the suspect earlier this month as the “lowest of the low” and said the gunman was likely on his way to becoming a serial killer despite not yet meeting the FBI’s definition of the term due to the number of killings and lack of time between them.

Police said the first victim was shot in the arm outside a convenience store in Logandale, roughly 60 miles north of Las Vegas, after being approached by a gunman in a vehicle. A few hours later in Las Vegas, Brian Wayne Clegg, 51, was fatally shot as he slept with a group of homeless people outside a mall. Another homeless man was shot in the face that same day as he slept, but managed to survive, police said.

A fourth victim, James Lewis, 64, who was also homeless, was then fatally shot on Feb. 2 as he slept under a bridge.

The homeless community in Las Vegas, meanwhile, had been taking precautions in the aftermath of the shootings, advocates told the Los Angeles Times.

“They were sleeping uneasy at night,” said Theresa Hicks, executive director of the Calvary Downtown Outreach. “The danger is here every day, and the homeless know it. But to add to it someone stalking you and could shoot you in your sleep is unnerving.”

With Post wires