"I have had enough of this crummy life ... Always the same. People are laughing at me, no one recognises my potential ... You will hear about me tomorrow. Make note of the name of the place: Winnenden," the 17-year-old said.
The remarks, part of a conversation with another 17-year-old from Bavaria who told his father about it after the shooting, were made at 2:45 am (0145 GMT), said Heribert Rech, interior minister of Baden-Wuerttemberg state.
Less than seven hours later, at around 9:30 am, Kretschmer entered the school in Winnenden near Stuttgart, armed with a handgun taken from his father's bedroom and more than 200 rounds of ammunition.
He fired 60 bullets at the school, killing eight girls, one boy and three female teachers, mostly with shots to the head. He then fled, hijacked a car and randomly shot dead three bystanders.
Three hours later Kretschmer was dead after a manhunt ended in a shootout 30 kilometres (20 miles) away. State police chief Erwin Hetger said it was believed he had turned the gun on himself.
Later Thursday, a grainy amateur mobile-phone video, apparently showing the killer's dramatic last moments and death, surfaced on the Internet.
The two-minute clip, featured on several media websites, shows a figure wielding a gun in a car park as shots ring out around him.
He then suddenly falls to the ground and seconds later is surrounded by dozens of police officers in green uniforms.
The bloodbath left Germany in shock. Flags flew at half mast across the country, and in Winnenden hundreds of candles were left outside the school.
Thousands packed churches for special services on Wednesday night and a vigil was held outside the school on what Chancellor Angela Merkel called "a day of mourning for all of Germany."
"Our thoughts go out to the families and the friends. We are thinking of you and we are praying for you," she said.
Details also emerged Thursday on Kretschmer's background.
His father is a successful businessman who employs 150 people at a packaging firm, according to police, but his son found it difficult to fit in at school and had few friends.
"He was simply not accepted by anyone and just sat all day in front of his computer," Mario, a schoolmate, told German television station N24.
Reports also said he was keen on computer shooting games -- especially the violent "Counter-Strike" -- and had become a real-life crack shot at the shooting range where his father was a member.
After leaving school last year, Kretschmer had enrolled on a course to train as a salesman. He regularly worked out at the gym, belonged to a sports club and was a keen table tennis player.
"He was completely unremarkable, there was nothing in his background to suggest this could have happened," Rech said. Fellow students described him as "quiet" and "reserved," even "friendly."
His father owned more than a dozen guns, all locked away except the nine millimetre Beretta pistol that caused the carnage. Police also found 4,600 rounds of ammunition at the house.
Rech said Kretschmer had apparently cracked an eight-digit code to a locked cabinet containing guns and ammunition.
The killer had "destroyed the soul of an entire school and ripped into the heart of a town," Rech added.
The school remains cordoned off and there have been calls for it to stay closed forever. Special counselling units have been set up to comfort victims' families and children who survived the attack.
The tragedy brought back haunting memories of a similar bloodbath in Erfurt in eastern Germany in 2002 that left 17 dead, including the gunman, and rekindled a debate over gun control.
Gun laws were tightened after Erfurt and there have already been calls for even stricter laws and even a ban on violent computer games.
Wolfgang Dicke, a police gun crime expert told Spiegel: "Our gun laws can barely be tightened because they are already so tight."
But a Bild editorial said: "The best laws in the world are useless, if parents do not know what is going on in their children's heads, what they are thinking and dreaming and what are their fears."