MONCTON, N.B. -- A man facing murder charges after three RCMP officers were gunned down in Moncton appeared briefly in court Friday, 17 hours after his arrest ended a manhunt that kept the small city in southern New Brunswick on edge with people locked in their homes.

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 night and two others were injured.

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 what appeared to be 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 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 manhunt under "the worst of circumstances."

"Tragic incidents such as this are a profound reminder of the risks our police officers assume every day in protecting the safety and security of all Canadians," he said. "Canadians are grateful for your dedication."

Shows of support for the RCMP have been felt across the country.

There were plans Friday night to light the CN Tower in honour of the three officers who died in the line of duty. The landmark in downtown Toronto will be 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.

Brown said almost 300 officers from different parts of the country were involved in the search for Bourque.

A woman who watched members of a tactical unit make the arrest in her frontyard 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 frontyard 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."