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.
Fredericton's deputy police chief Martin Gaudet said the two officers arrived at the apartment complex and saw two deceased civilians before being shot and killed themselves.
Gaudet says a 48-year old man with serious injuries was arrested. They didn't identify him.
No motive has been disclosed for the shooting.
Fredericton Police Chief Leanne Fitch identified the officers killed as Sara Burns, 43, who was married with three children, and 45-year-old Robb Costello who had a common law partner and four children. The two civilians killed, a man and a woman, were not identified.
Costello was a 20-year veteran of the force. Burns had been on the force for two years.
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.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.