A junior at the Air Force Academy will be jailed for 30 days and dismissed from the Air Force after admitting to cocaine use, the academy said Wednesday.

Cadet 2nd Class Ethan Walton pleaded guilty in a court-martial on Tuesday to unlawfully using cocaine on two occasions, which is a violation of Article 112a of the Uniform Code of Military Justice, and two specifications of a violation of Article 107 of the UCMJ, or making false statements to investigators.

A military judge sentenced Walton to 60 days in jail, the academy’s release said, but as part of a pretrial agreement with the academy’s superintendent, Lt. Gen. Jay Silveria, his time in jail will be capped at 30 days. He will also receive a reprimand, in addition to his dismissal from the Air Force.

The Gazette newspaper, in Colorado Springs, Colorado, reported last Friday that Walton lied to investigators when he tried to blame his positive cocaine test on eating drugged food at a bar. He also falsely denied going on a trip to Las Vegas with classmates in another interview with investigators.

The Gazette reported Walton was recruited to play football for the academy and played for its preparatory school, but has not made it on the academy’s varsity team.