A former high school senior from Orange County, California, has pleaded guilty to charges that he installed spyware on school computers in order to boost his grades.

Omar Kahan, of Coto de Caza, California, was one of two Tesoro High School students arrested three years ago in connection with the incident. The other student, Tanvir Singh, pleaded guilty in September 2008. Khan's guilty plea came as his trial was finally set to start this week.

Prosecutors say that in his senior year of high school, Khan developed a habit of breaking into school offices to steal tests and mess with the school's computers. He "installed spyware devices on the computers of several teachers and school administrators throughout his senior year," the office of the Orange County District Attorney said in a news release.

These passwords gave him access to the tests and the ability to boost his grades. Khan changed his Spanish, calculus and English grades from C's and D's to A's and a B+ and altered the grades of 12 other students, prosecutors said.

On April 18, 2008, he was caught cheating on a statistics test. That weekend he broke into the school's assistant principal's office and "stole the test in an attempt to destroy the evidence that he cheated," the DA's office said.

On April 21, he changed his transcript grades in the school's grade database and immediately asked for certified copies of his transcripts so that he could appeal rejection letters from the University of Southern California, the University of California, Berkeley, and the University of California, Los Angeles.

Singh tagged along with Khan to steal an English test during a May 19 nighttime break-in. He has since served 200 hours of community service, a DA spokeswoman said.

Khan, now 21, is due to be sentenced on August 26. Though he had been facing a maximum of 38 years in prison on the felony burglary and public-record tampering charges, he's expected to be sentenced to 30 days in jail, 500 hours of community service, and ordered to pay about $15,000 in restitution.

Robert McMillan covers computer security and general technology breaking news for The IDG News Service. Follow Robert on Twitter at @bobmcmillan. Robert's e-mail address is robert_mcmillan@idg.com