Prosecutors and attorneys for a South Carolina teenager accused of plotting to blow up his high school have agreed to ask for a 10-year prison sentence.

A judge Wednesday allowed 19-year-old Ryan Schallenberger to plead guilty to receiving and attempting to receive an explosive and attempting to damage and destroy real property by explosive. He could have faced up to 30 years in prison.

As part of the deal, prosecutors agreed to drop a charge of possessing an unregistered destructive device.

Schallenberger smiled at his parents as he came into the courtroom. His mother refused to talk to reporters.

Schallenberger was arrested in April 2008 after police say he had bomb-making materials delivered to his house in Chesterfield, about 55 miles southeast of Charlotte, N.C.