Rina Khan, 41, lost her temper and called the pupil a “muppet” after he got a question wrong, jurors were told.
"What she did was unlawful"
According to The Birmingham Mail, Peter Arnold - the lawyer for the prosecution - said that the 6-year-old boy was sitting in a Year Two Maths lesson.
Khan was allegedly standing behind the youngster when he got a question wrong - and lashed out.
Mr. Arnold said: "The defendant was upset about that and the long and short of it is that she had a plastic ruler in her hand and she hit the boy on the top of his head and the ruler broke."
“It is for that short action you are brought here to court. What she did was unlawful.”
When asked about the incident, the boy said it had hurt and that he felt "sad and scared," added Mr Arnold.
A teaching assistant has said that she had heard the teacher shouting loudly.
In a statement she said: "I looked up again and a piece of ruler flew across the room."
Rina Khan, of Milton Road, Smethwick, has denied a charge of child cruelty and common assault.
She said the ruler had snapped when she 'tapped' the boy on the head, but not as a result of any force used by her.
The trial continues.