A University of Connecticut student who had been wanted since Friday in the killing of two people was taken into custody on Wednesday night in Maryland after a multistate manhunt, the authorities said.
The student, Peter Manfredonia, a college senior who had fled Connecticut after a sequence of violent events that included a home invasion and kidnapping, was arrested in Hagerstown, Md., the Connecticut State Police said.
“The suspect will face justice and this will bring closure,” Trooper First Class Christine Jeltema said during a news conference on Wednesday night in Hartford, Conn. “This is what is important to the families of the victims.”
No law enforcement officers were injured when they apprehended Mr. Manfredonia, 23, who had been considered armed and dangerous, the authorities said. Trooper Jeltema said that a firearm that had been used in the second homicide was found near where Mr. Manfredonia was taken into custody.
She said his capture was the result of detectives using social media technology along with old-fashioned police work.
“We want to thank the public for providing leads,” she said.
Mr. Manfredonia could face state and federal charges, according to Trooper Jeltema, who said that he was being processed at a Maryland State Police barracks. The state police said they would release further details about his capture on Thursday.
Investigators said this week that they had recovered a stolen black Volkswagen Jetta, which had been driven by Mr. Manfredonia, in New Jersey near the Pennsylvania border. He was later spotted on foot in the Poconos region of Pennsylvania.
The U.S. Marshals Service and the Washington County Sheriff’s Office took Mr. Manfredonia into custody without incident near a Pilot truck stop, the Hagerstown Police Department said.
The authorities said Mr. Manfredonia had gone on a rampage, killing two people and wounding another person before fleeing. It was not immediately clear what prompted the attacks, the police said.
Michael Dolan, a lawyer for the Manfredonia family, said that Mr. Manfredonia was apprehended after he walked out of the woods near the truck stop.
“I know he’s safe and the parents are relieved and he surrendered, and he did what everybody hoped he would do,” Mr. Dolan said on Wednesday night.
Mr. Dolan said early this week that Mr. Manfredonia’s parents, sisters and other relatives had urged him to surrender. He said that Mr. Manfredonia had been struggling with anxiety and depression for several years and had worked with a number of therapists.
The police said that on Friday morning, Mr. Manfredonia used an edge weapon to kill Ted DeMers, 62, a woodworker who had stopped to give Mr. Manfredonia a ride in Willington, Conn., a small town about 30 minutes northeast of Hartford.
Mr. Manfredonia then seriously injured a neighbor who had tried to intervene, the police said.
On Sunday morning, he broke into a nearby home and held the homeowner captive before stealing his guns and a truck, the police said. He drove to the home of Nicholas J. Eisele, an acquaintance in Derby, Conn., and killed him, the police said.
Mr. Manfredonia then kidnapped another person from the home and stole the car that he used to flee to New Jersey, according to the authorities.
It was there that he released his captive, abandoned the vehicle and fled alone into Pennsylvania, where he was seen on foot in the Poconos region, the authorities said.
The F.B.I. and state authorities had embarked on a sprawling manhunt for Mr. Manfredonia, who started at the University of Connecticut in the fall of 2015, and is a senior enrolled in a joint business and engineering program.
Gov. Ned Lamont of Connecticut thanked law enforcement officers on Wednesday for their cooperation on the case.
“We are appreciative of their unified approach to this disturbing situation,” he wrote on Twitter.