Hans Beckert is the main character of the 1931 film M. He is a mentally disturbed pedophile and child killer who genuinely cannot stop himself from doing what he does and is haunted by guilt. He was played by Peter Lorre. Hans is also known for whistling the tune of "In the Hall of the Mountain King" throughout the film.
In the film's first scenes he is seen luring a little girl to him with a balloon and killing her offscreen. Later, police investigations are shown establishing that there is a serial child killer on the prowl and the local organized criminals are also looking for the killer because his presence in town has led to more police patrolling the streets, which is bad for "business". One criminal identifies Hans as the killer with some help from the balloon salesman from the beginning, and marks his jacket with the letter "M" so his associates can track him.
After causing some chaos while trying to follow him, the criminals capture Hans and put him on "trial" amongst their kind, expecting to kill him no matter what he says. Hans attempts to defend himself by pleading insanity: he claims he is compelled to commit his terrible crimes, for which he feels great remorse, by "the fire, the voices, the torment" raging in his mind. He then says that the other criminals have no right to judge him because they are criminals by choice, while he cannot control himself. The criminals are unmoved by his pleas, and move in to kill him. However, the police arrive just in time and arrest everyone in the room.
The film ends before the real court of law declares Hans' sentence.
Hans was portrayed by Peter Lorre, who also portrayed Le Chiffre in a 1954 television adaptation of the James Bond novel Casino Royale.