The 28-year-old woman woke up shortly after midnight when she heard her boyfriend pacing around her flat in Oberhausen, North Rhine-Westphalia, a police spokesman said.
Her son woke up too – and the 27-year-old man went into the boy's bedroom and stabbed him several times with a knife.
“The mother grabbed her son and ran out into the street,” the police spokesman said.
Neighbour Annegret Sante said she heard the woman screaming. "I heard the mother calling, 'Help, help, my child. Someone call the police, he's bleeding to death'," she said.
Police arrived and managed to keep the boy alive until medical emergency services arrived, but he died later in hospital.
Police confirmed to the WAZ regional newspaper on Thursday that the man had suffered from depression and panic attacks, and was taking medication to help with his problems. He and the boy's mother had been together for about half a year, the paper said.
He had not been violent before, the paper said. After attacking the boy with an 18-centimetre long kitchen knife, the man hurt himself so badly that he had to be put in an artificial coma, although his life is not thought to be in danger.
Three children who were killed in Dortmund last week, before their flat was set on fire, will be buried in Turkey, it was announced this week. Their father's girlfriend is suspected of having killed the children aged four, 10 and 12.