Justin Bourque was arrested shortly after midnight Friday inside a large perimeter in the city set up by police to contain him after one of the worst mass shootings in the RCMP's history.
Three officers were killed Wednesday and two others were injured.
The city rallied around the Mounties on Friday night as hundreds attended a vigil in the rain outside RCMP headquarters. The steps to the building were piled high with flowers.
"We have to appreciate what they are doing," said Victor Babineau of nearby Dieppe. "Maybe we don't do it as much as we should."
A spontaneous reception line formed as people walked up to thank two officers, shaking their hands.
Heather Russell of Riverview watched the gathering crowd with mixed emotions.
"It's a very sad occasion but you have to be proud at the same time," she said.
Bourque, 24, is charged with three counts of first-degree murder and two counts of attempted murder.
He appeared in provincial court, packed with about 70 people, under heavy guard. A tactical officer with an automatic rifle stood at the back of the courtroom.
Before his court appearance, a van was whisked into the court building followed by another vehicle carrying at least three tactical officers.
Bourque, who has long brown hair and a scruffy beard, wore blue-green, prison-issued scrubs. He did not speak or show any emotion, staring forward at the judge during the five-minute court appearance.
He was remanded to appear in court July 3 after the Crown and defence asked for a month to prepare.
The RCMP say the Moncton man was unarmed at the time of his arrest. A witness said he surrendered to police, uttering the words: "I'm done."
His arrest ended a search that lasted nearly 30 hours and brought the city of 69,000 people to a virtual standstill. A large swath of northwestern Moncton had been locked down after the officers were shot, with residents asked to remain inside their homes with their doors locked.
Supt. Marlene Snowman said while Bourque was unarmed when he was arrested, police found weapons near the wooded residential area where he was taken into custody.
Pausing to gather her composure, Snowman thanked residents for keeping their outdoor lights on, an aid to police in their night-time search.
"It has been a very challenging 30 hours or more for the officers who worked around the clock to get this done," she told a news conference.
Assistant Commissioner Roger Brown, the Mounties' commanding officer in the province, said it will take time for the department to heal as he released the names of the officers who were killed and injured.
Brown said the officers who died were: Const. Dave Ross, 32, originally of Victoriaville, Que.; Const. Fabrice Georges Gevaudan, 45, originally of Boulogne-Billancourt in France; and Const. Douglas James Larche, 40, of Saint John, N.B.
The injured officers are constables Darlene Goguen and Eric Dubois. Police said one of the injured officers has been released from hospital and the other suffered injuries that are not life-threatening.
Larche, who worked in Miramichi before he joined the detachment in the Moncton area, was a highway patrol and general duty officer who received a commander's commendation six years ago for saving the life of an unconscious baby in Moncton. He had been a member of the RCMP for 12 years.
Ross joined the RCMP from Ottawa after graduation in July 2007 and was posted to the detachment based in Moncton as a general duty police officer.
Linda Ross, the aunt of Ross, told The Canadian Press on Friday that her nephew leaves behind his wife Rachel and an 18-month-old son. She said Rachel has another baby due in September.
"Dave has been married for four years and he was perfectly happy, he had found his soulmate," Ross said in a telephone interview from Victoriaville.
"He was really happy, really passionate about his work and he was an excellent person."
Gevaudan was born in France and joined the RCMP in Regina. After his graduation from the training academy on Feb. 11, 2008, Brown said Gevaudan was posted to the detachment in Moncton as a general duty police officer.
Brown commended the work of his officers under trying conditions.
"Fortunately, most people will never have to experience what our officers have gone through in the past couple of days," Brown said. "Their resilience is truly remarkable."
He said members of the RCMP will rally together to get through what has been an ordeal for the Mounties and the community.
"This is the start of a very long road for all of us," he added.
Public Safety Minister Steven Blaney commended the RCMP for showing bravery in "the worst of circumstances."
A woman who watched members of a tactical unit make the arrest in her front yard said the experience was scary.
"They started yelling, 'Come out with your hands up!' and they had their guns loaded," said Michelle 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 front yard where they had him sprawled on the ground."
The manhunt began Wednesday at around 7:30 p.m. when police 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.
For some, the arrest meant they could return to their homes.
Colin Slaunwhite, 24, said he went to play hockey on Wednesday and wasn't allowed to return home, leaving his mother frantic.
Asked how it felt to go home, he replied: "Relief. A whole bag full of emotions."
Shows of support for the RCMP have been felt across the country.
Toronto's CN Tower honoured the three officers who died in the line of duty. The landmark was lit in red, blue and gold, the colours of the RCMP guidon.
In Prince Edward Island, the RCMP thanked residents for visiting detachments with food and flowers.
And a program set up in partnership between Moncton's Rotary Club, the Mobile Giving Foundation and the RCMP Foundation that allows mobile phone users to donate money to the families of the slain officers raised $12,000 in the first 30 minutes it was made available, said Bernard Lord, president of the Canadian Wireless Telecommunications Association.