A Greenwell Springs man will enter a year-long pretrial diversion program that could avoid a criminal conviction for allegedly threatening the lives of President Barack Obama and other government officials, a federal judge said in a court filing Friday.

Successful completion of the program’s terms would bar criminal prosecution of 27-year-old Abram Kane Williams, U.S. Magistrate Judge Stephen C. Riedlinger said during a hearing Wednesday.

Riedlinger approved the pretrial diversion agreement before filing it into the court record Friday.

“You’re being given an opportunity to get these charges out of your life a year from now,” Riedlinger told the Iraq War veteran at the earlier hearing.

“Take advantage of this opportunity,” Riedlinger added. “Not many people get it.”

Williams was arrested in July 2010 on the basis of a Secret Service complaint that alleged he ranted to staff at the Louisiana Office of Veterans Affairs about Obama, Gov. Bobby Jindal and U.S. Rep. Bill Cassidy, R-Baton Rouge.

The Secret Service complaint added Williams then threatened to “take them out.”

The former member of the Louisiana Army National Guard later denied threatening the lives of the three office holders.

Williams testified he was angry the U.S. Department of Veterans Affairs ceased paying for counseling and prescriptions he said were needed for emotional problems caused by combat operations.

Williams remained in federal custody for more than a year and received psychiatric evaluations before Chief U.S. District Judge Brian A. Jackson ordered him released three months ago. Jackson also ruled that Williams had become competent for trial.

Dr. Randall Rattan, a forensic psychologist at the Federal Correctional Institution at Fort Worth, testified in January that Williams suffers from paranoid delusions.

But Rattan added that he does not consider Williams a danger to himself or others.

And Rattan also said in January Williams was not competent to assist his attorney at trial.

The forensic psychologist recommended additional therapy.

The pretrial diversion agreement filed Friday by Riedlinger bears Williams’ signature and that of his attorney, Brent M. Stockstill.

The agreement also is signed by U.S. Attorney Donald J. Cazayoux Jr. and Assistant U.S. Attorneys Michael J. Jefferson and Frederick A. Menner Jr.

In that document, Williams agreed to accept responsibility for the statements that led to the charges against him.

The prosecutors agreed to dismiss all charges if Williams complies with all rules of the pretrial diversion program for one year. And no conviction would appear on his record.