Authorities said he was born in Mannheim, not far from Viernheim, but was living far away in northern Germany and appeared to have returned to the area for the attack.

There is no evidence linking him to Islamic extremism or far-Right groups, and police believe it was a lone incident.

Rudolf Egg, a criminal psychologist, told Germany’s DPA press agency: “If anyone opens fire with a gun in a cinema, he has to expect it to be considered a terrorist threat and to have to deal with a heavily armed SWAT team.

“He had to reckon with being killed by the police in staging this show of violence in the style of a terrorist attack, and may even have intended it to end that way.”