President Obama has shaved a few years off the sentence of a federal inmate who mistakenly received a longer prison term because of a typo -- a typo that would have meant three-and-a-half more years in prison if it hadn't been caught. 

Ceasar Huerta Cantu, 46, was sentenced to 15 years in federal prison after pleading guilty to marijuana and money laundering charges in Danville, Va., in 2006.

However, the judge who issued his sentence based the prison term on a mistake in his paperwork, which assigned Cantu a higher base offense level than was warranted. This mistake led Cantu to be sentenced to an extra three-and-a-half years in prison.

In 2012, Cantu filed a motion to change or vacate his sentence based on the error, but a judge ruled that Cantu had not caught the error in time to rectify it through judicial means.

The judge said the only way for the mistake to be fixed was through clemency, which Obama granted Tuesday. The White House said Obama decided to grant clemency because it was the only way to correct the mistake. 

"Given the circumstances of this case and the manifest injustice of keeping a person in federal prison for an extra three and a half years because of a typographical mistake, the president wanted to act as quickly as possible," said Obama press secretary Jay Carney. "This is a matter of basic fairness and it reflects the important role of clemency as a fail-safe in our judicial system."

Cantu will now serve 11-and-a-half years in prison. He is currently being held at a federal prison in Louisiana.