Royal Canadian Mounted Police Constable Damien Theriault said police responded to a call Wednesday about an armed man in the north end of the city of Moncton at 7:30 p.m. Three of the officers were killed and two sustained non-life threatening injuries and were in stable condition.
"We are still actively looking for the shooter," Theriault said. "He is believed to still be in the Pinehurst subdivision area of Moncton. We are urging people in that area to stay inside and lock their doors and for people to say away from that area."
Asked how he was dealing with his grief, Theriault said he personally knew the officers before breaking down and excusing himself because he couldn't complete his sentence.
Police said they were looking for 24-year-old Justin Bourque of Moncton - a city of about 69,000 people about 95 miles (150 kilometers) northeast of the capital of St. John, New Brunswick. The police force tweeted an image of a suspect wearing military camouflage and wielding two guns.
Danny Leblanc, 42, said he saw the shooter in the distance Wednesday evening, wearing a camouflage outfit and standing in the middle of the street with his gun pointed at police cars.
The construction worker said he believed it was an RCMP officer he was looking at until he heard a burst of automatic gunfire coming from the man's gun.
He said he quickly retreated into his home and remained there with his family. At one point a neighbor posted on social media that their kitchen window was shattered by gunfire.
Leblanc said few people on his normally quiet street were sleeping as they awaited word at midnight on whether arrests had been made.
Word that police had been killed shocked the city, Leblanc said.
"It's devastating. I don't know if he was on a hunt for them, or what," he said.
Police had a number of roads in the city blocked and traffic was backed up on major arteries across the city. Drivers were also asked to stay out of the area.
Moncton Mayor George LeBlanc urged all residents to pay strict attention to the RCMP warnings.
"The police and other emergency personnel are working under extremely difficult conditions and need our complete cooperation. Stay home, stay safe. If you cannot get home, seek out a friend or family and remain there until you are advised otherwise," LeBlanc said in a statement.
Such violence is rare in Canada, particularly on Canada's East Coast.
Four Royal Canadian Mounted Police officers were shot and killed in the western Canadian province of Alberta in 2005 in the deadliest attack on Canadian police officers in 120 years. They had been investigating a farm in Mayerthrope, a small hamlet in Alberta when a man shot them before he was killed.
The Horizon Health Network, a provincial health authority, said on its Twitter feed that two patients were taken to Moncton Hospital with gunshot wounds. Horizon Health said the two shooting victims are in stable condition.
Sean Gallacher, who lives near the area where police were concentrating their search, said he heard what he now believes were gunshots but initially thought his daughter had dropped some toys on the floor above him.
"I was downstairs and heard a few bangs," said Gallacher, 35.
Canadian Public Safety Minister Steven Blaney tweeted that he was "shocked by the tragedy" and that his thoughts and prayers were with frontline RCMP officers.
Associated Press writer Rob Gillies in Toronto contributed to this report.