The man facing manslaughter and criminal-negligence charges in the Quebec boy's death may have been present simply to protect the child's mother from a man alleged to have been harassing her.
Nicolas Lacroix, 36, was formally charged Friday at the courthouse in Quebec City and will remain behind bars until a bail hearing next week.
The boy, Nathan Lecours, died after being struck by a bullet from a handgun that discharged on Thursday night in a home in Levis, near Quebec City.
Quebec provincial police said they wouldn't provide any details about what happened inside the home. Earlier Friday, before the negligence and manslaughter charges were laid, the police force had strongly indicated that it was looking into the possibility that the incident was an unintentional act.
Local police reported receiving a 911 call from the home in Levis, just across the river from the provincial capital.
When they arrived they found the boy dead and two adults, including the child's mother, in a state of shock.
Neighbours also supported the accident theory. They recounted hearing Lacroix and the mother screaming outside the duplex on Thursday evening.
Nancy Bergeron told Radio-Canada that Lacroix kept repeatedly shouting, "It's my fault!" She told reporters that she had to keep him calm because he expressed a desire to kill himself.
Lacroix is not related to the child. He had come to the home on Thursday night.
Lacroix was picked up by investigators from the hospital while the mother was released. Police spokesman Richard Gagne described Lacroix as an acquaintance of the toddler's mother.
Some reports said Lacroix had gone over to the home because the mother feared for her safety.
Earlier Thursday, the mother had complained on Facebook that she was being threatened. In a status update on Thursday morning, the mother said a man in his 40s had been harassing her.
"I fear for my safety and that of my son, the process with the police is too long for my taste, and my stalker is mad. Now he calls me to scare me and insult me," she wrote.
Gagne confirmed the alleged threats were part of the police investigation but would not confirm there was any link to Nathan's death.
On Friday, people came by the home to drop off flowers and stuffed animals in the little boy's memory.
His father posted a lengthy video of the blond-haired boy on YouTube.
Police say an autopsy will be conducted and neighbours are being questioned.
Lacroix's bail hearing will be held early next week.