TOKYO — The attacker was heard screaming “Die!” as he ignited the liquid he had splashed around an anime studio in Japan.

Within minutes the studio, Kyoto Animation, was a scene of horror: a man hanging from a ledge as flames licked the walls; a pile of bodies on a staircase leading to the roof; a barefoot woman so badly burned that all a bystander could do was spray her with water and wait for help.

By the time the fire was doused, 33 people had died and three dozen had been injured, shocking a nation considered one of the world’s safest. The blaze appeared to be its worst mass killing in decades, and prompted a global outpouring of grief, especially among fans of anime — a school of animation that has become synonymous with Japan.

The attack shook a country still reeling from a stabbing rampage in a Tokyo suburb just weeks ago. Prime Minister Shinzo Abe said the latest attack left him “at a loss for words.”