A 17-year-old student suspected of a shooting rampage at an Ohio high school that killed three teenagers and wounded two others has confessed to opening fire on students he chose at random, prosecutors said Tuesday.

The student, identified by authorities as T.J. Lane, appeared in Geauga County, Ohio Juvenile Court, where he was ordered detained following Monday's shooting at Chardon High School.

Lane has confessed to taking a knife and a .22-caliber pistol into the high school cafeteria and firing 10 rounds at randomly selected students, prosecutors said.

As the shocked town 35 miles east of Cleveland prepared for a vigil to honour victims of the attack, the medical examiner

pronounced two more students dead from wounds suffered when Lane opened fire.

Demetrius Hewlin and Russell King Jr., 17, were both declared dead, said a spokesman for Cuyahoga County Medical Examiner's office. Daniel Parmertor, 16, was declared dead on Monday.

One student remained hospitalized and another has been released. At the high school, students spent the day huddling, talking and placing red ribbons around the grounds.

In his court appearance, Lane was ordered held in detention pending the filing of formal charges. A judge gave prosecutors until March 1 to file charges.

Authorities said they expected to release the results of an autopsy on Parmertor later on Tuesday and said autopsies may be performed on Hewlin and King on Wednesday.

King had no brain activity when he arrived at MetroHealth Medical Centre and was declared brain dead, the medical examiner's office said.

Hewlin's family confirmed his death in a statement saying: Demetrius was a happy young man who loved life and his family and friends.

We will miss him very much but we are proud that he will be able to help others through organ donation, it said.

Previously, students and local media had identified Lane as a student at a school for at-risk youth whose family said they were in shock over the events and asked for privacy.

The family wanted me to convey to the citizens of Geauga County and Northeastern Ohio that the family is devastated by this most recent event, the Lane family's lawyer Bob Farinacci told local WKYC news prior to Tuesday's hearing.

This is something that could never have been predicted. T.J.'s family has asked for some privacy while they try to understand how such a tragedy could have occurred and while they mourn this terrible loss for their community.

The school district was closed on Tuesday and will not reopen fully for classes until Friday.

Chardon schools Superintendent Joseph Bergant has praised the actions of teachers, who he said had acted quickly to protect the students.

MOTIVE A MYSTERY

Chardon Police Chief Tim McKenna did not disclose a motive on Tuesday for the shooting, which happened on Monday morning while students were studying and eating breakfast.

Some witnesses told local media he appeared to target a table where a student who had started dating his former girlfriend was seated with friends.

The Lane family's lawyer described the suspect as a good kid who had never been in trouble and had impressive grades.

He's a sophomore. He's been doubling up on his classes with the intent of graduating this May. He pretty much sticks to himself but does have some friends and has never been in trouble over anything that we know about, Farinacci said.

Student Sebastian Diaz-Rodriguez said Tuesday he was in the cafeteria when the shooting started and heard assistant football coach Frank Hall intervene.

I hit the ground and heard Mr. Hall yell 'hey' at the shooter, Diaz-Rodriguez said. The shooter turned to Mr. Hall and ran out. Mr. Hall chased him.

He did what he usually does, Diaz-Rodriguez said Hall, adding he regularly breaks up disagreements.

Hall could not be reached to comment but his mother, Mary Hall, said in a telephone interview: He says he doesn't really feel like a hero.

He thinks anyone would have done the same thing, she said.

Diaz-Rodriguez said he ran out of the cafeteria into another room with a female student, and the two realized she had been shot. He and a student who had received emergency medical training applied pressure to the wound, he said.

Chardon student Danielle Samples, 16, told Reuters she was in the cafeteria when she heard a series of pops and then someone shouted to run down the hallway. She heard another round of pops while she was in the hall, Samples said.

Samples said the suspected shooter was a student at Lake Academy in Willoughby, which serves at-risk students, who had been at Chardon's cafeteria waiting for a bus. She said the student lived with his grandparents and sister.

Chardon freshman Sofia Larkins, 14, said she was sitting with Lane's sister when the shooting began. She didn't know anything, Larkins said. She was surprised as anyone.

Chardon, the seat of Geauga county, is a semi-rural, affluent town about 35 miles (56 km) from Cleveland with a population of about 5,000, according to the U.S. Census.

The deadliest school shooting in the United States was a 2007 massacre at Virginia Tech University that left 33 people dead. The deadliest high school shooting claimed 12 students and a teacher in 1999 at Columbine High School in Colorado.

(Reporting by Kim Palmer, Dan Burns, Andrew Stern, James B. Kelleher and David Bailey; Editing by Ellen Wulfhorst and Paul Thomasch)