CHARLOTTESVILLE, Va. (AP) — A former University of Virginia law student has pleaded guilty to breaking into the school's registrar office to intercept a request for his transcript.

Prosecutors say Joshua Gomes had a summer internship arranged with a New York law firm that had indicated it would submit a transcript request. The Daily Progress reports ( Gomes was worried he would lose his internship because he had inaccurately reported his GPA.

Court documents say that on Dec. 6 a university employee noticed an adhesive hook hanging on the wall in the office's diploma room. When she removed the hook from the wall, she found that it was attached to a flash memory card, and the hook was determined to be a covert video camera. A video file showed a man matching Gomes' description rifling through an office file cabinet.

Prosecutors say Gomes acknowledged breaking into the building three times and stealing his transcript. When police searched his home, they found packaging and a receipt for the camera used to scout the office.

Defense attorney Bonnie Lepold said Gomes was under pressure academically, as well as in his personal life.

Under the plea agreement, the commonwealth agreed to discontinue the possession of burglary tools charge and one armed robbery charge. The commonwealth also agreed to reduce the remaining armed robbery charge to unarmed robbery, reducing his maximum punishment from life in prison to 20 years incarceration.

Gomes will be sentenced in December.