Heavily armed police, paramedics and firefighters quickly descended to the scene and ordered the closure of the neighborhood, catching some early risers in nurseries, cafeterias and other businesses.
Others were seen being escorted by police from their homes, some still in their pajamas and barefoot, to a safe place beyond a police cordon.
Authorities in the provincial capital initially urged people in the Brookside neighborhood to stay inside, describing an "active incident" on Twitter.
About an hour after giving the first news of the murders, a second and then a third message from the police said: "At this time, we can confirm that we have a suspect in custody" and "of the four people killed in the shootings from this morning "Brookside Drive, two were Fredericton police officers".
Then came the news that the threat had been neutralized, the blockade was closed and the police cordon was reduced to a few blocks: "We can confirm that there are no more threats to the public, and no confinement is required at this time."
In addition, the police added: "We can confirm that the suspect in custody is currently being treated for serious injuries related to the shooting incident this morning."
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.
Fredericton Police Director Leanne Fitch had a press conference scheduled at 3:30 p.m. local time (1830 GMT) about the shooting in a sleepy residential area of the city north of the city center.
& # 39; Pop, pop, pop, pop & # 39;
The public broadcaster CBC quoted Robert DiDiodato, who lives in the area, who said he had heard a series of "firecrackers" around 7 in the morning.
"With the pace, it could have been a shot," he said. "It was a kind of pop, pop, pop, pop."
He said that about five minutes later he could hear similar sounds near his house.
"The doors are closed and everyone is inside," he said, according to CBC.
Another resident, who only gave his name as Justin, told the station: "I woke up and heard shots and looked out of my window.
"The police were trying to put one of the officers in their vehicle to take them to a safe place," he said, adding that he tried to help, but the officers told him to take cover.
The mass shooting is the second in the province in recent years, and occurs only a few 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 injuring another 13 people.
The latter prompted a public debate on the increase in armed violence and gangs in Canadian cities, and calls for a ban on small arms.
"Most crime rates (in Canada) are declining and have been declining for several decades, but incidents of gun violence have increased in the last five years," said Public Safety Minister Ralph Goodale.
He said the local police would lead the investigation, suggesting there was no concern for national security.
"Terrible news coming out of Fredericton," Prime Minister Justin Trudeau said in a Twitter message.
"My heart is with everyone affected by the shooting this morning, we are closely following the situation," he said.
Bouquets of flowers and notes of condolences began to pile up outside the Fredericton police station, while a local church scheduled a prayer vigil on Friday night and the provincial government urged anyone in need of counseling to ask for help.
In 2014, three federal police officers were killed and two others wounded after responding to an emergency call about an armed man wandering through a residential neighborhood near Moncton, New Brunswick.
There was a 28-hour chase before police caught up with the suspect and arrested him, in what was described as the second deadliest attack against the Royal Canadian Mounted Police (RCMP) since four officers were ambushed on a Mayerthorpe farm. , Alberta in 2005.