Five people have been killed by a gunman who opened fire along a walking trail in North Carolina’s capital city and eluded officers for hours before he was cornered in a house and arrested, police said.

An off-duty police officer was among those killed in Raleigh by the suspect, who police only described as a white, juvenile male.

He was later arrested. His identity and age were not released.

The gunfire broke out at around 5pm on Thursday (10pm BST) along the Neuse River Greenway in a residential area north-east 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 gunman.

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

Governor Roy Cooper told reporters: “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.”

North Carolina Shooting
Law enforcement officers congregate outside an armoured vehicle at the Aldi on New Bern Avenue in Raleigh after five people were shot and killed in the Hedingham Neighborhood and Nuese River Trail area (AP)

Authorities did not offer any details on a motive, but Ms Baldwin joined Mr 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.”

The Raleigh shooting was the latest in a violent week across America. Five people were killed on 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.

Police officers have been shot 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.