The shooting occurred in July last year when a young man went on an unprovoked knife attack against locals in the centre of the normally peaceful seaside town of Varberg, in western Sweden.
The man went on a rampage, stabbing two men and one elderly woman who later died of her injuries. The police officer shot the man, who was carrying a 34-centimetre kitchen knife in hand at the time.
The officer fired two warning shots. He later shot at the man's leg but missed. Then he successfully fired at the man's leg and abdomen as he started crawling towards the officer.
Prosecutors later suggested that it was not justified to fire the last shot, as the man was already gravely injured from the thigh wound and posed no immediate threat to the police officer.
But a court ruled on Friday that the officer was in an "emergency" situation and that the five fired shots were justifiable as self defence.