Len Wild was knocked to the ground as he ordered the men out of Mitchell high school, in Hanley, Stoke-on-Trent. The men, all in their 20s, had been seen intimidating youngsters in the playground.
Two ran off but the third punched Mr Wild to the ground. At least a dozen pupils surrounded him on the school steps until the attacker left.
Mr Wild, who is in his mid-50s, suffered leg injuries and is expected to be detained in the North Staffordshire hospital for another week recovering from a knee operation.
Maurice Lewis, the chairman of governors, said the attack had reminded him of the one involving Philip Lawrence, the London headteacher who was stabbed to death while defending a pupil outside his school in December 1995.
Mr Lewis said: "Mr Wild dashed to protect the pupils, as I would expect him to do. Two of the intruders ran off, but the other decided to stand his ground. He punched Mr Wild in the face.
"The kids immediately encircled him to protect him from any further attack. Knowing the children, they would do that, and knowing Mr Wild, he would not think about himself."
The incident at Mitchell High was caught on the school's security cameras which the police are using in their hunt for the intruders.
The school installed security cameras on its site five years ago to improve security, and some teachers carry walkie-talkies. The grounds are used as a short-cut between housing estates.