A policewoman was shot in the head by a man who grabbed her gun and opened fire, also injuring bystanders, at a commuter station in a Munich suburb.

Officers had been called to the Unterfoehring subway station following reports of a row among passengers on a train.

When officers arrived at the S-Bahn station in the northeastern suburb of the Bavarian city on Tuesday morning, a man attempted to push them onto the tracks.

Munich police spokesman Marcus da Gloria Martins said the attacker then managed to grab the female officer's service pistol and fired several shots before he was shot himself and taken into custody.

The officer was described as being in a life-threatening condition, while the two bystanders shot suffered less serious injuries. The suspect was seriously injured by gunfire, German police said.

"There was one suspect and we've got him," da Gloria Martins told reporters at the scene.