The 17-year-old was found guilty of shooting dead the officer on 30 June.
A 17-year-old boy in Sweden has been imprisoned for eight years for murdering a police officer in Gothenburg.
The teenager was found guilty of shooting dead the officer on 30 June and was charged with murder, attempted murder, and serious weapons offences.
The 30-year-old officer was fatally shot while on the patrol in the Biskopsgården district of the city. He later died from his injuries.
It was the first time an active police officer had been shot dead in Sweden in 14 years.
The suspect initially fled the scene but was arrested the next day when a gun linked to him was found in a nearby forest.
Prosecutor Linda Wiking had told reporters last month that officials do not believe the murder was planned. The 17-year-old suspect had denied the allegations.
According to investigators, the suspect had been shooting at three members of a rival gang when the police officer arrived on the scene.
The gunman then allegedly fired two bullets at the officer, one of which fatally wounded him.
The Biskopsgården neighbourhood of Gothenburg has become notorious for violence and gang crime in recent years.
Swedish caretaker Prime Minister Stefan Lofven had expressed outrage over the killing, calling it an "attack on our open society".
"We will never back down in the struggle against organised crime," he told a news conference in July.
In 2020, there were more than 360 incidents involving firearms in Sweden, with a record 47 deaths and 117 injuries, police say.