Tim Kretschmer, a German teenager dressed in black combat gear, entered the Albertville secondary school, north of Stuttgart, and went on a gun rampage killing nine students and three teachers.
He then fled the school in Winnenden, south-west Germany, but shot himself dead after being cornered by police.
Al Jazeera's Mark Seddon reports from the scene.