Two police officers were among four people killed Friday in a shooting in eastern Canada and a suspect has been arrested, authorities said.
Residents of the Brookside neighborhood of Fredericton, New Brunswick reported waking to the sounds of multiple gunshots.
Witnesses described to the Canadian Broadcasting Corporation (CBC) seeing the barrel of a rifle or shotgun poking out from the window of a low-rise apartment building and firing into a courtyard, while the bodies of two officers lay on the ground nearby.
Heavily armed police, paramedics and firefighters quickly descended on the scene and a lockdown of the neighborhood was ordered, trapping some early risers in daycare facilities, coffee shops and other businesses.
Others were seen being escorted by police from their homes — some still in pyjamas — to safety beyond a police cordon.
Authorities in the provincial capital initially urged people in the Brookside neighborhood to stay indoors, describing an "active incident" on Twitter.
Around an hour after giving first word of the killings, a second and then a third message from police said: "At this time, we can confirm that we have one suspect in custody" and "of the four people killed in this morning's shootings on Brookside Drive, two were Fredericton police officers."
Then came word that the threat had been neutralised, the lockdown was lifted and the police cordon was shrunk to a few blocks: "We can confirm that there is no further threat to the public, and lockdowns are not required at this time."
Also, police added: "We can confirm that the suspect in custody is currently being treated for serious injuries related to this morning's shooting incident."
The circumstances of the shooting in Fredericton, about 75 kilometers (45 miles) from the border between Canada and the US state of Maine, were not immediately clear.
The shooting happened in a sleepy residential area of the city north of downtown.
Public broadcaster CBC quoted Robert DiDiodato, who lives in the area, as saying he heard a series of "firecracker" sounds around 7 am.
"With the tempo, it might´ve been a gunshot," he said. "It was sort of like a pop, pop, pop, pop."
He said that about five minutes later he could hear similar sounds near his home.
"Doors are locked and everybody's inside," he said, according to CBC.
Another resident, who gave his name only as Justin, told the broadcaster: "I woke up and I heard gunshots and I looked outside my window.
"The cops were trying to put one of the officers in their vehicle to take them out to safety," he said, adding that he tried to help but was told by the officers to take cover.
Another resident, Pierre Huard, told Radio-Canada he initially thought the sounds were "children playing with firecrackers."
The mass shooting is the second in the province in recent years, and comes only weeks after a man opened fire on July 22 in a bustling nightlife district of Toronto, killing an 18-year-old woman and a 10-year-old girl, and wounding 13 other people.
The latter triggered a public debate on rising gun violence and gangs in Canadian cities, and calls for a handgun ban.
"Awful news coming out of Fredericton," Prime Minister Justin Trudeau said in a Twitter message.
"My heart goes out to everyone affected by this morning's shooting. We're following the situation closely," he said.
In 2014, three federal police officers were killed and two more were injured after responding to an emergency call about an armed man roaming a residential neighbourhood of nearby Moncton, New Brunswick.
A 28-hour manhunt ensued before police caught up to the suspect and arrested him, in what was described as the second-deadliest attack on the Royal Canadian Mounted Police (RCMP) since four officers were ambushed on a Mayerthorpe, Alberta farm in 2005.