An 18-year-old student tossed a homemade bomb into a high school classroom in southern Japan on Friday, wounding 58 teenagers when the gunpowder-filled jar exploded near the teacher's desk, spraying the room with shards of glass, officials said.

Police arrested the suspect and were questioning him, but said his motive remained unclear in the attack at Hikari public high school in Yamaguchi state (search).

One male student was seriously injured with cuts to his legs and abdomen, and another student broke his finger. But the other injuries were minor, Fire Department official Noboru Baba said.

All of the 58 students treated at two nearby hospitals were aged 17 or 18. They included 37 students in the targeted classroom as well as students in a neighboring room who suffered ear aches or shock, officials said. Seventeen students were hospitalized.

The device burst into flames and exploded with a loud bang after it landed just in front of the teacher's desk, spreading shards of broken glass, the Yamaguchi police spokesman Kazunori Uchida said.

"As one would expect, some of the students appear to be in shock," school principal Yukio Hironaka said. "We had never imagined that our students would bring such a dangerous material to school."

The school, which is known as one of the best in the area, canceled the rest of the classes and sent home all the students for the day. School officials planned to call an emergency meeting with teachers and parent representatives later Friday to discuss their measures.

The bomb was fashioned from a jar filled with a combination of gunpowder and other substances, police said. The Kyodo News Agency said the jar was about 8 inches tall.

The suspect, a senior whose homeroom was next to the targeted class, was seized by a male teacher who rushed to the scene before the police arrived.

Public broadcaster NHK said the student told police he had hard feelings to some of the students in the targeted class and had planned to hurt them.

Uchida said the student only acknowledged he made the bomb himself, but did not confirm his motive. The student was "agitated" and investigators ended the day's questioning, the spokesman added.

The student had never skipped any classes until Friday when he missed his English class in order to carry out his plot, Kyodo reported.

NHK said his classmates described the student as a quiet loner who wouldn't even say a word to a teacher asking him questions in class.

The suspect, whose name was not released, was charged with inflicting bodily injury, Uchida said.