A shooting in a small Canadian city early Friday left four people dead, including two police officers, under circumstances that were not yet explained but struck a nerve in a country that has been roiled in recent months by several instances of mass violence.

People in Fredericton, the capital of New Brunswick in the eastern part of the country, said they heard as many as 20 gunshots following a confrontation that prompted police to initially cordon off a large section of the city with emergency vehicles and order residents to remain inside their homes and businesses.

Finally, after a tense period of waiting, authorities disclosed the toll: Among the four killed were two officers, a rare case of police killed in the line of duty in Canada. Their names were not released.

Authorities said one suspect was in custody and was being treated for serious injuries. The person’s identity was not announced and no motive was disclosed. A news conference was planned for later Friday.

Several other victims were being treated at a regional hospital, but there were no immediate details on the nature of their injuries or their conditions.

“Our hearts are broken by the murder of our two brave police officers,” Fredericton Mayor Mike O’Brien said in a tweet.

The entire province of New Brunswick had 11 homicides in 2016.

In Fredericton, a city of about 60,000 residents, people said they were stunned by the scene, which occurred as people were heading to work or dropping children at a day care center not far from the apartment complex where the shooting took place. “This is the first time I’ve even heard of any serious crime or violent crime in this city,” said Travis Hrubeniuk, whose fiancee had just left their home when the sirens began.

Bill Henwood, a funeral director at York Funeral Home, whose business is located inside the cordoned off area on Brookside Drive, said people sat in their cars or were just standing near the blockade of police and fire vehicles “hanging tight and waiting for word” for news.

“It’s not something that we expect in Fredericton to wake up and hear about,” Henwood said. “To see that there’s actually fatalities is pretty extraordinary for this area.”

The shooting comes as Canada wrestles with a string of violence, including an instance in Toronto last month where a man with a handgun opened fire in a crowded part of the city, killing two people and wounding 13 before he either shot himself or was killed by police.

In April, a man who linked himself to a misogynistic online community used a van to run down pedestrians in a busy part of Toronto, killing 10 people and injuring 14.

Authorities are still pursuing leads in an ongoing investigation of a serial killer who has been charged with killing eight men in the city in recent years.

In 2014, a shooting in Moncton, New Brunswick left three Royal Canadian Mounted Police officers dead and two wounded.