A former aide to Congressional candidate Carl DeMaio was sentenced to five years of probation Monday for using a phony email account to make it appear DeMaio or one of his associates threatened him.

While he avoided jail time, Todd Bosnich will also have to complete 240 hours community service, to take part in a mental health treatment program and to pay a $2,500 fine. In June, Bosnich pleaded guilty in federal court to a felony count of obstructing justice, admitting he lied to the FBI when questioned about that email.

According to documents released by the U.S. attorney’s office, Bosnich set up a “dummy” Yahoo email account, using a false gender and date of birth. He then used that account, elimanagment@yahoo.com, one time “to send a particularly ugly and threatening message.”

Prosecutors said that email “suggested that the ‘anonymous’ author of the email would ensure” Bosnich would never work in politics again if he continued to make allegations against DeMaio.

At the time, that threatening email was believed to have been sent by an anonymous user. It became one element of controversy after Bosnich was fired from DeMaio’s campaign.

On Monday, Bosnich made his first public remarks on the incident, stating he takes full responsibility for his actions and is "very sorry" for what he did. His attorney told the judge Bosnich is suffering from severe depression and has been seeking psychiatric help for the last six months.

The prosecutor requested Bosnich be sentenced to probation but wanted to ensure the felony count remains permanently on his record in case he ever wants to go into politics again. The judge said Bosnich will not be able to wipe this charge from his record like state or local cases.

The probation department said this case has "no victims," but the judge said he strongly disagreed with this. Although there is no proof this incident alone cost DeMaio the race for the District 52 Congressional seat, the judge said it definitely played a role.

DeMaio, his campaign, and the democratic process itself are the real victims in this case, the judge said.

DeMaio sent this statement after the sentencing:

“Todd Bosnich’s lies were incredibly painful, smeared my reputation, and ultimately derailed our Congressional campaign.

"Although no length of sentence can ever undo the damage he has done, what matters is that Bosnich was unmasked as a liar and is now a convicted felon.

"I want to thank the FBI and US Attorney for exposing Bosnich’s lies and seeking justice in this matter. I also want to thank the thousands of supporters who stood by me and saw this disgusting smear for what it was. Your faith and support sustained me through this nightmare.”

Last October, Bosnich accused DeMaio of sexual harassment. DeMaio flatly denied the allegations, calling them outrageous lies.

Click here to read the full plea agreement.

According to federal prosecutors, Bosnich’s sent the “anonymous” email to himself “to bolster his claims that DeMaio was threatening him to remain silent about the alleged sexual harassment. In this fashion, Defendant's claims about DeMaio's sexual harassment appeared not only to be legitimate, but to take on a new and, perhaps, more sinister context.”

The Grand Jury issued subpoenas to attempt to identify who sent the threatening emails, according to prosecutors.

Click here to read more about the charges.

After becoming aware of the “anonymous” email and the “serious nature of the allegations” contained in it, the San Diego Police Department notified the FBI.

In October, NBC 7 Investigates first reported that anonymous emails sent to Bosnich were the subject of FBI agent interviews with potential witnesses.

According to court documents, the FBI spoke with Bosnich last year. During that meeting Bosnich was told he was being interviewed as a victim as part of an investigation “into whether DeMaio had sent or caused the sending of the threatening emails, which he had discussed with the SDPD and the media.”

According to prosecutors, during that meeting with the FBI, Bosnich “speculated” whether it was DeMaio or someone else with the politician's campaign that sent the email.

Bosnich also said, “DeMaio was fond of sending emails (and communicating via Twitter) using alias accounts,” and “that DeMaio used this tactic quite often.”

According to court documents, the FBI met with Bosnich again in October 2014. At that meeting, Bosnich “repeated his claim that he and his mother received a total of three threatening emails. When questioned specifically about the authorship of these emails, Defendant falsely asserted several times that he 'did not know' who sent him the Threatening Email. Defendant also stated that he suspected that the author might have been DeMaio or one of his close associates.”

Bosnich “made a serious and foolish mistake,” Frank Vecchione, Bosnich’s attorney, said in court Friday. Vecchione said Bosnich is now in counseling for his problems.

By writing the email and telling the SDPD, the FBI and the media he did not know who sent the email Bosnich, according to prosecutors, attempted to influence the DeMaio investigation. “He acted corruptly as he recognized that what he was telling the government was inaccurate and did, in fact, influence a pending official proceeding.”