TEXARKANA, Texas — A Texas actress pleaded guilty in federal court on Tuesday to making the toxic agent ricin that was sent in letters to President Barack Obama and New York Mayor Michael Bloomberg.

As part of a deal reached with federal prosecutors that has yet to be approved by a judge, Shannon Guess Richardson, 36, would spend 18 years in prison and then five years on supervised release, according to court documents.

Richardson, whose career included minor television roles in shows such as “The Walking Dead,” pleaded guilty to charges of manufacturing and possessing the biological agent ricin, which was found in the letters.

The New Boston, Texas, woman was initially charged with one count of making a threat against the President of the United States and two counts of mailing threatening communications.

She tried to blame her husband for the letters, sent in May, testing positive for the presence of ricin, according to prosecutors.

The letters read, in part: “You will have to kill me and my family before you get my guns. Anyone wants to come to my house will get shot in the face,” according to court documents.

Notice of the plea deal was filed last month in the U.S. District Court for the Eastern District of Texas.

Richardson was arrested in June and a federal grand jury accused her in a three-count indictment of mailing the letters to Obama, Bloomberg and Mark Glaze, the director of Mayors Against Illegal Guns, a group founded by Bloomberg that lobbies for stricter gun laws.

Ricin, a highly toxic substance, is found naturally in castor beans, but it takes a deliberate act to manufacture it and use it to poison people, according to the U.S. Centers for Disease Control and Prevention.

Exposure to even a small amount of ricin can cause death and no known antidote exists.