Giovanna Nobile, 54, had gone into the Pappalardo di Vittoria school in southern Sicily for a teachers' meeting and was confronted by Salvatore Lo Presti as she was leaving the building.
Lo Presti, known as "the poet" around school because of his passion for writing poems, shot her five times in the abdomen before another teacher tackled him and forced him to drop the gun.
The janitor, who was a few days off his retirement, fled the scene but was caught by police in a nearby street and arrested for murder.
"He was mad at the world, but he never did anything more than rant. He was a calm type really, I would never ever have thought he would be taken over by such rage," fellow janitor Biagio Cirica told Italian media.
"I've known him for nearly 30 years. Did he secretly hate her or did he have a weakness for her? How can we know," he said.