COLUMBIA, S.C. (AP) — Former U.S. Senate candidate Alvin Greene was officially enrolled Friday in a pretrial intervention program that will drop a misdemeanor obscenity charge against him if he completes community service and counseling.

At the end of this month, the unemployed Army veteran is scheduled to begin orientation for the program, which prosecutors said will likely take about a year to complete. A felony obscenity charge is also being dropped because of a lack of evidence.

The deal announced by Solicitor Dan Johnson earlier this week means Greene — who would have faced several years in prison if convicted — won’t face any time behind bars as long as he successfully finishes the program.

Greene, 33, was arrested in November 2009 after police said he used an old college ID to get past dorm security and into a computer lab at the University of South Carolina. He was accused of showing a pornographic picture to a female student. Last year, his attorney said Greene’s actions were a misguided attempt at flirting.

Greene told The Associated Press he was glad prosecutors were letting him enter the program but insisted he did not show a pornographic picture to the student.

Word of the criminal charges didn’t emerge during the run-up to the Democratic primary a year ago, in which Greene, doing no campaigning, stunned an established party regular by taking 59 percent of the vote. The charges surfaced the day after Greene’s victory, setting off several months of awkward television interviews and appearances.

Greene, who mustered just 28 percent of the vote as he lost to U.S. Sen. Jim DeMint in last year’s general election, picked up less than 1 percent of the vote when he ran for his local South Carolina House seat in a special election earlier this year. Still unemployed and living with his ill father in their childhood home, Greene says he is still mulling a run for president.

Copyright 2011 The Associated Press.