Everett Basham faces a maximum of 10 years in prison when he is sentenced on charges that include an attempted terrorist threat, illegal possession of handguns and assault weapons, forgery and possession of destructive devices.

Santa Clara County Deputy District Attorney Alaleh Kianerci said Basham, 46, entered the plea under a deal in which several charges were reduced or dismissed.

Prosecutors said he was upset with a bill introduced by Sen. Leland Yee that would have limited the rapid reloading of assault weapons. Yee’s bill ultimately died in the Legislature.

Basham sent Yee an email in January threatening to use his sniper skills to assassinate the San Francisco Democrat while hiding in the shadows of the state Capitol, authorities said.

“We definitely thought it was a serious threat,” Kianerci said. “It was a very detailed and serious threat.”

However, she said Basham has a minimal criminal history, which led to the plea deal.

“I hope that this man receives all the help he needs,” Yee said in a statement thanking law enforcement. “As I said back in February, threats like these will not deter me from pushing for common sense gun safety legislation to protect our children and our communities.”

In addition to the attempted terrorist threat, Basham pleaded no contest to felony charges of reckless possession of a destructive device, possession of materials with the intent to make a destructive device, forgery of government identifications and three counts of possession of an assault weapon. The devices were found inside his Santa Clara home, authorities said.

Pleading no contest means Basham isn’t admitting guilt but will face penalties as if he had been convicted.

The three misdemeanors were possession of a destructive device, carrying a concealed weapon in a vehicle and carrying a loaded concealed weapon in a vehicle.

The forgery charge was possession of fake military identification. Prosecutors dismissed a second forgery charge and a second count of possessing materials with the intent to make a destructive device. They also reduced a terrorist threat charge to an “attempted” threat.

Basham is due back in court Dec. 17, when a date for a sentencing hearing will be set.