RALEIGH, N.C. (AP) — Five people were killed by a shooter who opened fire along a walking trail in North Carolina’s capital city on Thursday and eluded police for hours before he was cornered in a home and arrested, police said.

An off-duty police officer was among those killed by the suspect, who police only described as a white, juvenile male. He was arrested around 9:37 p.m., authorities said. His identity and age weren’t released.

The gunfire broke out around 5 p.m. along the Neuse River Greenway in a residential area northeast of downtown, Raleigh Mayor Mary-Ann Baldwin said. Officers from numerous law enforcement agencies swarmed the area, closing roads and warning residents to stay inside while they searched for the shooter.

Two people, including another police officer, were taken to hospitals. The officer was later released, but the other survivor remained in critical condition.

“Tonight terror has reached our doorstep. The nightmare of every community has come to Raleigh. This is a senseless horrific and infuriating act of violence that has been committed,” Gov. Roy Cooper told reporters.

Authorities didn’t offer any details on a motive, but Baldwin joined Cooper in decrying the violence.

“We must stop this mindless violence in America, we must address gun violence,” the mayor said. “We have much to do, and tonight we have much to mourn.”

Brooke Medina, who lives in the neighborhood bordering the greenway, was driving home at around 5:15 p.m. when she saw about two dozen police cars, both marked and unmarked, race toward the residential area about 9 miles (14 kilometers) from Raleigh’s downtown. She then saw ambulances speeding the other direction, toward the closest hospital.

She and her husband, who was working from home with their four children, started reaching out to neighbors and realized there was a shelter-in-place order.

The family closed all of their window blinds, locked the doors and congregated in an upstairs hallway together, said Medina, who works as a communications vice president at a think tank. The family listened to the police scanner and watched local news before going back downstairs once the danger seemed to have moved further away from their home.

“We’re just going to hunker down for the rest of the night and be very vigilant. Keep all of our lights on, doors locked,” she said.

She described the neighborhood known as Hedingham as a sprawling, dense, tree-lined community that’s full of single-family homes, duplexes and townhomes that are more moderately priced compared to other parts of the Raleigh area.

Medina said she often takes her kids on bike rides along the greenway during the day, but typically brings pepper spray along just in case.

“There’s a lot of places one could disappear,” she said.

The Raleigh shooting was the latest in a violent week across the country. Five people were killed Sunday in a shooting at a home in Inman, South Carolina. On Wednesday night two police officers were fatally shot in Connecticut after apparently being drawn into an ambush by an emergency call about possible domestic violence.

It followed shootings of police officers this week in Greenville, Mississippi; Decatur, Illinois; Philadelphia, Las Vegas and central Florida. Two of those officers, one in Greenville and one Las Vegas, were killed.

Thursday’s violence was the 25th mass killing in 2022 in which the victims were fatally shot, according to The Associated Press/USA TODAY/Northeastern University Mass Killings database. A mass killing is defined as when four or more people are killed excluding the perpetrator.

___

Dazio reported from Los Angeles. Associated Press writers Michael Kunzelman in Silver Spring, Maryland and Gary D. Robertson in Raleigh contributed to this report.