Justin Bourque was arrested at around 12:10 a.m., RCMP spokesman Paul Greene said, bringing to a close a harrowing search that lasted nearly 30 hours.
Michelle Thibodeau said she saw members of a tactical unit arrest the Moncton man in the frontyard of her home.
"They started yelling, 'Come out with your hands up!' and they had their guns loaded," said Thibodeau, 21.
"About five minutes later, Justin surrendered himself and he said, 'I'm done,' and then they arrested him and brought him to my frontyard where they had him sprawled on the ground."
She said the experience was scary.
"I'm still shaking," she said. "My heart dropped to my stomach and I felt quite sick actually. It was a moment I'll never forget."
Linda Peacock, who lives a few doors down from where the arrest was made, said she was relieved the suspect had been apprehended.
"It's very upsetting to know that he was so close to my home," Peacock said. "I'm very glad they got him."
Bourque, 24, was the subject of an exhaustive manhunt after the shootings Wednesday evening in the northwest area of the city.
Moncton, a city of about 69,000, had been at a virtual standstill up until the arrest, with buses pulled off the roads, government buildings shut down and schools closed as the RCMP scoured the streets for a heavily armed man.
Residents in a cordoned off area were told to stay inside their homes, lock their doors and turn on their exterior lights in an effort to aid the search.
But shortly after Bourque's arrest, people were allowed outside their houses and roads that had been blockaded for more than a day were reopened, Greene said.
Colin Slaunwhite, 24, said his mother was frantic because he had not been able to return home until Friday morning after playing hockey Wednesday.
"Relief. A whole bag full of emotions," Slaunwhite said after he learned he could return home.
"It is going to take a while for the adrenalin to completely run out and everybody tries to comprehend what happened."
Police including tactical officers began their manhunt Wednesday at around 7:30 p.m. when they responded to a call about a man walking along a road with what was believed to be a gun.
After the call, shots were fired and officers called for backup.
The RCMP said police officers from across the country were brought in to help arrest the suspect.
At one point, Bourque was seen Thursday morning but officers were unable to arrest him after he went into a wooded area, the RCMP said.
Assistant Commissioner Roger Brown, the commanding officer of the Mounties in New Brunswick, said Thursday likened the search to "working through your worst nightmare."
The RCMP said Thursday that of the two wounded officers, one was released from hospital and the other had injuries that were not considered life-threatening.
The identities of the officers who were shot have not been released by police.
But late Thursday, the National Post identified one of the officers fatally shot as Const. Dave Ross, a police services dog handler with the RCMP. The newspaper quoted the sister-in-law of the man's wife as saying he had a young son, with another child expected in September.
People laid flowers in a makeshift memorial on the doorsteps of the local Codiac RCMP detachment. One of the bouquets was wrapped in a ribbon reading, "Fallen heroes."
The RCMP have scheduled a news conference for Friday at 8 a.m.
Cpl. Danny Falls said while RCMP members were pleased to bring a measure of relief to residents, the force was contending with mixed emotions.
"There obviously have been long days and we suffered significant loss," Falls said Friday morning. "It will take some time to heal from that."
Bourque was not known to police and investigators were trying to piece together his background.
He was wearing military camouflage and carrying two rifles in a picture of him released by police on Twitter on Wednesday night.
The deadly shootings struck a nerve not only in Moncton, but throughout the country, where flags were flown at half-mast, including the flag at the Peace Tower in Ottawa. MPs also observed a moment of silence in the House of Commons.
The shootings also evoked memories of an RCMP tragedy in Mayerthorpe, Alta., nine years ago when Constables Anthony Fitzgerald Orion Gordon, Lionide (Leo) Nicholas Johnston, Brock Warren Myrol and Peter Christopher Schiemann were shot and killed.