DETROIT (AP) — A person waiting for the bus and another walking their dog were among four people shot, three fatally, by a man who appeared to fire randomly over about 2 1/2 hours in Detroit, police said.

Police arrested a suspect Sunday night after an hourslong manhunt. Chief James White said tips led officers to the suspect, though no other information was released.

Photo: Detroit Police Department

“This did not need to happen,” White said. “Once again, Detroiters are reeling after lives were senselessly taken at random from our community.”

White said investigators traced all four early Sunday shootings to one firearm but believed them to be random because there was no apparent connection among the victims.

A 40-year-old woman was shot multiple times and killed around 4:45 a.m. Sunday, followed two hours later by the fatal shooting of another 40-year-old woman, police said.

Around 7:30 a.m., a 28-year-old man was killed, White said.

A 76-year-old man said he saw a man peering into vehicles. When he told the suspicious person to get away from the cars, the gunman fired at him, police said. He survived.

Mayor Mike Duggan credited “critical information” from the community and multiple law enforcement agencies with helping police take the suspect into custody.

“As we mourn our three neighbors who were killed, we should take the time to appreciate all the men and women in law enforcement whose work today made sure no other families will suffer at the hands of this shooter,” Duggan said.