The suspected gunman in a Moncton shooting rampage that left three RCMP officers dead and another two injured appeared in court Friday.

Justin Bourque, 24, has been charged with three counts of first-degree murder and two counts of attempted murder.

He was arrested in a wooded area of Moncton, N.B., at 12:10 a.m. Friday. He appeared in a Moncton courthouse on Friday afternoon under heavy guard, wearing blue prison garb as an officer with an automatic rifle stood guard. CTV's John Vennavally-Rao reported that Bourque -- who stood expressionless during a brief appearance that lasted about five minutes -- was represented by a duty counsel.

He was remanded to appear in court July 3 after the Crown and defence asked for a month to prepare.

Neither the Crown nor defence recommended a psychiatric assessment at this time, said Vennavally-Rao.

Bourque's arrest ended a manhunt that lasted more than 30 hours and involved more than 300 law enforcement personnel, police said.

The Moncton man was unarmed at the time of the arrest, though police said weapons were recovered close by.

“This is the outcome that we wanted,” RCMP superintendent Marlene Snowman said in a news conference on Friday morning. “We wanted to have the arrest done as quick as possible, without further injury or death to anyone.”

Moncton resident Michelle Thibodeau witnessed the arrest, and saw Bourque taken into custody in her backyard. “They were screaming, ‘Come out with your hands up!’” she told CTV News on Friday. “Without anything else, he just came out and said, ‘I’m done.’ And he had his arms raised.”

‘Long road’ ahead

Bourque was wanted in connection with the shooting deaths of three RCMP officers on Wednesday evening. Two other RCMP were injured in the same attack.

Police confirmed Friday, that the three Mounties shot and killed Wednesday are Const. David Ross, Const. Fabrice Georges Gevaudan, and Const. Douglas James Larche. The two other officers who were shot and injured are now recovering well.

RCMP J Division Commanding Officer Roger Brown said the healing can now begin.

“This is the start of a very long road for all of us,” Brown told reporters.

Brown also thanked the many other law enforcement agencies that contributed to the arrest. “We had resources and equipment here from across Canada,” he said.

Snowman said police successfully captured Bourque thanks to a combination of experience, technology and co-operation from the public.

New Brunswick Premier David Alward said it’s a “miracle” no one else was injured during the incident.

“This is a period of incredible relief as a community and as a province,” Alward told reporters after the news conference on Friday. “I’m so grateful that it ended safely. It’s reflective of the incredible work that the RCMP has done.”

While the police investigation is ongoing, Moncton residents who were advised to stay home during the search are now free to resume their normal routines.

Parents ‘in shock’

As the community mourns the loss of three Mounties, family friend Don Sonier told CTV News that Bourque’s parents are trying to understand what happened.

“Parents are in shock, embarrassed,” he said. “Their family life has been probably destroyed from now on.”

Bourque, who had been living in a nearby trailer park, was known as a gun enthusiast. He’d also posted messages online that suggested he had a distaste for authority.

But a man who knew Bourque described him as an avid hunter who had a funny, generous side.

“The guy I knew, he would gladly help me out if I needed $20 for the kids’ school lunches or something, he would help me out,” said Kerry Fitzpatrick.

Virginia Boudreau said on the day of the shooting, she saw Bourque walking down the street with a crossbow and a rifle. She said she was alarmed by the expression on his face.

“He wasn’t happy, he wasn’t sad, he wasn’t angry,” she said. “It was just nothing.”

With files from CTV News’ John Vennavally-Rao