A federal judge sentenced an Idaho inmate to three years in prison for threatening to kill George W. Bush in a letter in which the accused called the U.S. president "stupid," federal prosecutors said on Wednesday.

Ricky Arnell Ward, 20, put his name and address on the January 2006 letter he sent to the FBI claiming he planned to kill the president because "he is a stupid ... man."

Ward said Bush needed to be killed before he got "all the people in the USA killed," according to a release by the U.S. attorney's office in Idaho. He was sentenced on Monday.

When questioned by the Secret Service about the letter, Ward told them he was periodically visited by "command hallucinations," among other mental ailments, and if he received one concerning Bush after he was released from Ada County Jail in Boise, he might act on it.

He later signed a plea agreement admitting the threat, officials said.

Ward was already serving time for unrelated charges that included threats against state officials, violation of a protection order and lewd conduct with a minor.