One Uruguayan inmate thought he had a found the keys to his freedom…literally.

Ramón Eduardo Mendez Fialho somehow managed to get his hands on a set of handcuff keys used to unlock shackled prisoners in the country’s capital of Montevideo. He then promptly gulped it down.

He apparently thought he could pass the keys through his bowels and, once cleaned, use it to free himself the next time he was cuffed. Or maybe he wanted to make money by selling the keys.

Unfortunately for the crafty convict, the bosses at Santiago Vazquez prison had recently upgraded their security and had put in a new state-of-the-art X-ray machine in the prison. When Mendez passed through the X-ray, officials could see a shadow of the tiny key in his lower abdomen.

Authorities are still trying to unlock the secret of how Mendez obtained the keys and an investigation has been launched by prison chiefs.

Orestes Leles Da Silva, an assistant director of security at the prison, praised his new security and the guards who caught the key-stealing jailbird.

“Before, if a person had come into the prison with something metallic like handcuff keys in their body, it would not be detected,” he told El Pais. “Today, thanks to this new system, we were able to detect the prohibited item.”

No word if Mendez has tried to get a family member to sneak a file hidden in a birthday cake into the prison.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino