A heavily armed man identified as Justin Bourque was photographed in Moncton at the time of the shootings
Canadian police say they have arrested a man suspected of killing three police officers and wounding two others in Moncton, New Brunswick.
The Royal Canadian Mounted Police in New Brunswick tweeted that Justin Bourque was arrested just after midnight in Moncton.
Justin Bourque arrested by RCMP at 12:10 in Moncton. He is in police custody. Residents of north Moncton can now leave their homes.
— RCMP New Brunswick (@RCMPNB) June 6, 2014
News of the arrest came after a huge manhunt went into its second night.
Schools and government offices were closed and residents told to stay indoors during the operation.
Police said residents of Moncton could now leave their homes.
'I saw him arrested'
A grainy image purporting to show Justin Bourque being taken into custody was circulating on social media.
A local resident named Michelle Thibodeau tweeted that she had witnessed the arrest.
"He was in my backyard. I saw him arrested in front of my eyes," she said.
He was in my backyard. I saw him arrested in front of my eyes. He is alive. Thank you #RCMPNB.
— michelle thibodeau (@YourMichelle) June 6, 2014
"The Swat team arrived at my house and unloaded and started screaming in my backyard for him to surrender and he did. I watched it happen."
Stephen Puddicombe, a reporter for Canadian broadcaster CBC, said Mounties at the local RCMP headquarters smiled and hugged each other after the arrest was made.
"I think that's a celebration that you'll see repeated privately with Mounties around this city over the next several hours," he said.
Barricades that had sealed off roads during the manhunt started coming down soon after news of the arrest leaked out, the Globe and Mail reported.
Earlier, police said the suspect, who was wearing camouflage gear and carrying rifles, had been spotted several times in north Moncton.
Dozens of police officers were seen scouring the search area with weapons drawn. Armoured security trucks were also visible.
One of the wounded Royal Canadian Mounted Police (RCMP) officers has been released from hospital, and one remains in hospital in a stable condition.
The officers were shot while responding to a report of an armed man at the north-west side of the town at about 20:00 local time (23:00 GMT) on Wednesday.
It was the deadliest attack on the country's police force since four officers were killed by a gunman on a farm in the western Canadian province of Alberta in 2005.