A student at a junior high school for children with disabilities who was punished for passing gas in class with an essay-writing assignment in which the pupil promised not to do it again, was also shamed in the classroom when the teacher in charge decided to display the composition, school officials said Sunday.

The school said it was a problem to restrict something as natural as farting and said that the action, which amounted to punishment, was "excessive."

"I will fart in the restroom during recess," the student at the special-needs school in Tochigi Prefecture wrote. The student was told to write the essay in June last year.

The school declined to disclose the name, sex and other personal details of both the student and the teacher.

According to the school, the student and the teacher agreed on how to compose the essay, but the student was not told what to write.

The essay also said: "If I break my promise, I will run 10 laps" in the school's running area. But the student was never actually ordered to run, the school said.

Later the same month, the essay was removed from display after an objection that the action taken was inappropriate.

The incident was not reported to the prefectural education board until late March this year.

An official of the board pledged that an incident of this kind would not happen again.