President Obama has shortened the sentence of an inmate who was given a longer prison term than he was supposed to have because of a clerical error.

Ceasar Huerta Cantu pleaded guilty to drug and money laundering charges in a Virginia federal court in 2006. He was sentenced to 15 years in prison.

According to court records,  Cantu pleaded guilty in 2006 to one count of money laundering and one count of conspiring to possess 1,000 kilograms or more of marijuana and 5 kilograms or more of cocaine with intent to distribute.

"The quantity of drugs are just amazing to say the least," Judge Jackson L. Kiser of federal district court in Danville, Va., said during sentencing, according to court records.

Federal sentencing guidelines placed Cantu's offenses at a level 34, but someone mistakenly typed in level 36. This led Kiser to use a different set of guidelines that were more stringent. Cantu was sentenced in May 2006. The error added an additional 42 months to Cantu's prison sentence.

Obama shortened Cantu's prison sentence Tuesday from 15 years to 11 and a half years. The White House said the move corrects a clerical error and sets the record straight.

According to court records, Kiser said that Cantu, who is from Katy, Tex., didn't file a motion pointing out the error until July 2012 and that the mistake was only discovered a few months earlier. Kiser dismissed Cantu's motion to downgrade his sentence, ruling that the time to appeal the original judgment had expired. 

Because of the judge's ruling, White House officials said, Cantu's case could only be shortened through presidential clemency.