Police in Sweden detained a 17-year-old on Friday after the murder of a police officer in the west coast city of Gothenburg.
The young man is accused of murder and attempted murder, according to the prosecutor.
The officer was shot on Wednesday evening in the Biskopsgarden district, an area known for gang crime. He died of his injuries.
The suspect lives in the area and was said to be part of the gangland scene.
The police officer was not thought to have been killed deliberately, the prosecutor said, adding that the shots may have been fired for another reason.
The case triggered horror in Sweden, particularly among the police. Some 200 people were questioned, following a large-scale manhunt.
Regional police chief Klas Johansson said the police were relieved to have made such progress in a brief period of time.