I'm pursued by ghosts. Ghosts of mothers and those children… they never leave me. They are always there… always, always, always! Except... when I do it, when I… Then I can't remember anything.
~ Beckert explaining his actions

Hans Beckert is the main character of the 1931 film M. He is a mentally disturbed pedophile and child killer who murders several little girls, creating a panic and bringing both the police and organized crime down on him.

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 with a balloon andkilling her offscreen. Later, police investigations are shown establishing that there is a serial child killer on the prowl. The mob is 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.

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.

According to the director Fritz Lang in a 1963 interview, he based Beckart off many German serial killers like Fritz Haarmann, Carl Großmann, Peter Kürten, and Karl Denke.