An appeals court in Sweden has thrown out the life prison sentence imposed on the man who killed Swedish Foreign Minister Anna Lindh last year.
Mijailovic has "significant psychiatric problems"
Mijailo Mijailovic, 25, will now be taken from prison to a closed psychiatric ward after tests concluded he was suffering a mental illness.
An initial psychiatric assessment after his arrest concluded he was not mentally ill when he killed Lindh.
The minister was hugely popular and her death shocked Sweden.
She died of her injuries on 11 September last year, a day after Mijailovic stabbed her while she was out shopping in a Stockholm department store.
The appeals court said Mijailovic needed psychiatric care because he was a "traumatised person with significant psychiatric problems".
Mijailovic's lawyer Peter Althin said he was satisfied with the ruling.
"I am an optimist," he said. "So when the experts were of the opinion that there was a serious mental disturbance, I would have been somewhat surprised if the appeals court hadn't agreed that he needed psychiatric care."
Chief Prosecutor Agneta Blidberg was quoted as saying she accepted the verdict but did not say whether she would appeal to the Supreme Court.
Mijailovic would have gone to prison for 15 years, the normal term in Sweden for those sentenced to life, but now he faces being placed in a psychiatric institute for criminals.
However, there are no time limits for psychiatric patients, and some experts say he could be set free in a matter of months if deemed healthy.
This process involves a review by a county administrative court at which prosecutors are entitled to put their case.
The court did uphold the guilty verdict against Mijailovic for murdering Lindh.
His defence had sought the lesser charge of manslaughter, arguing Mijailovic had not intended to kill the politician.
Mr Althin had told the court Mijailovic had heard voices telling him to attack Lindh, but that they said nothing about killing her.
The killing was an "impulsive act", he said, adding that it was a "coincidence" Mijailovic's victim was Anna Lindh.
But the court ruled: "It has been proven that Mijailo Mijailovic was completely
indifferent as to whether Anna Lindh would die of her stab wounds and he therefore had intent to kill."
Lindh had been tipped as a future prime minister.
Her death stunned a nation which had still not come to terms with the unsolved killing in 1986 of the then prime minister, Olof Palme.