(CNN) -- With three police officers dead and two others wounded, Justin Bourque had finally admitted "I'm done" and given up.
Two months later, he made it official.
The 24-year-old Canadian man pleaded guilty Friday to three counts of first-degree murder and two counts of attempted murder, his lawyer David Lutz said.
He is set to be sentenced October 27.
Bourque's submission stands in contrast to the brazen relentlessness he showed in June, when he embarked on a grisly rampage through Moncton, New Brunswick, some 150 kilometers (93 miles) northeast of Saint John.
The carnage prompted people to shutter themselves in their houses and barricades to spring up around Moncton, a city of 140,000 people that had no homicides at all in 2011 and 2012.
It ended early June 7, when Bourque was arrested after yelling through a window, a nearby resident told CNN partner CBC.
"They (police) were screaming for about five minutes and they had their guns loaded," the resident, Michelle Thibodeau, told CBC. "And eventually Justin came out with his hands up and he yelled, 'I'm done.' And they collected him and brought him to my front yard, where he lay sprawled out. "
The slain Royal Canadian Mounted Police officers were Constables David Ross, 32, Fabrice Georges Gevaudan, 45, and Douglas James Larche, 40.
Why did Bourque do it?
A Facebook page that purportedly belongs to him has many posts with pro-gun photos and a few anti-police memes.
There is also a photo where two men pose with shotguns in the snow. It was posted on February 25, six days after the Facebook page was created, and is used as the profile picture.
According to CBC, the judge at Borque's hearing Friday told the defendant he could be facing consecutive life sentences with no chance of parole for 75 years for the three first-degree murder charges.