It was an unfortunate series of legal loop holes if I recall correctly.
Japan had a hell of a similar situation when Nikolai II of Tsar Russia visited young and fresh Imperial Japan, when in a super rare incident of public outrage, someone SLICED Nikolai II. He survived but basically the entire government of Japan expected it was only a matter of time before they got colonized by Russia.
Unfortunately, Japan also had something to prove at the time. It had to prove it was a civilized nation. So it was torn between 2 difficult choices:
1) Russia wants the terrorist get the death sentence
2) According to Japanese law, what the assailant did was not a death sentence crime, so he will instead be imprisoned for life.
So the problem was:
If Japan chose 1, it'll embarrass itself to the entire world that was actually very interested in this case (for obvious reasons) because if they treated the terrorist with a treatment that wasnt even on its books, its as if the new Nation of Law Japan doesn't even follow its own laws AKA it'll buckle to scary old Russia and do whatever when scared and also set a terrible precedence of saying the LAW isn't actually the law, it can be circumvented on a whim.
2) Follow the law, and piss off Russia. What is the point of following of a law if you will no longer have a country to even have to call your own with those laws.
Japan ultimately chose 2. In an insane historical turn of events, the world clapped, and Russia respected the decision. If I recall correctly, Nikolai II even said he understood that this incident was not to blame on the Japanese government or the majority of the Japanese people.
Anyway thats all.