Eighteen people died when an expelled former pupil went on a shooting spree at his school in the eastern German city of Erfurt.

Masked and dressed in black, the gunman walked through classrooms killing 14 teachers, two schoolgirls and one of the first policemen on the scene before taking his own life.

He was clothed completely in black and you could only see his eyes.

Pupil who witnessed the killing

Pupils of the Gutenberg School spent four hours trapped inside before police could declare the building safe.

Chancellor Gerhard Schroeder described the massacre in the quiet provincial city as "beyond the powers of the imagination".

As four other victims were being treated in hospital, people gathered in the city for a church service in the evening.

Pupils also tried to get help using their mobile phones

It is the worst school massacre in Europe since the 1996 shooting in Dunblane, Scotland, when a deranged gunman killed 16 children, a teacher and himself.

BBC Berlin correspondent Rob Broomby says the incident is also the worst of its kind in Germany's post-war history.

The German authorities have not given the name of the Erfurt killer but they said he was a 19-year-old who had been expelled from the school several months earlier and told he could not sit his university entrance exam.

Exams

"We were sitting in class doing our work and we heard a shooting sound," said eyewitness Filip Niemann.

Major school shootings:

1996: 16 children and a teacher shot dead at Dunblane Primary School, Scotland

1998: 4 pupils and a teacher killed by 2 boys aged 11 and 13 at Westside Middle School, Arkansas, in the US

1999: 12 pupils and a teacher killed by 2 teenage gunmen at Columbine High School, Colorado in the US