MIAMI (CBS4) – A former Miami-Dade firefighter who had allegedly sent sexually explicit messages to  a 17-year-old boy will not face any jail time and instead will enter into a 12-month program to avoid a criminal record.

Ulises Rodriguez, 36, agreed to a lesser charge of child abuse no great harm and, if he successfully completes the program, which includes entering into a mentally disordered sex offender program, the charge will be dismissed, both prosecutor and defense attorneys said in court Wednesday.

READ MORE: Psychologist shares how to talk to your child about Texas school shooting

It’s a resolution that the state said the victim’s father was also in agreement with.

The alleged relationship came to light when the boy died and someone discovered sexually explicit text messages and pictures on the teen’s cell phone, according to police.

According to Rodriguez’s arrest affidavit, the first sexually explicit messages and graphic pictures were sent to the teen’s phone on May 1, 2011. The last messages allegedly from Rodriguez were sent to the teen two days before the teen died at the end of June. The medical examiner has not yet determined the teen’s cause of death, but police say it does not appear to be related to the alleged relationship with Rodriguez.

READ MORE: New FBI report finds active shooter attacks on the rise

Rodriguez had originally been charged with 17 counts of Transmitting Harmful Material to a Minor.

His lawyer, Michael Mirer, said he hopes the case will be dismissed.

Mirer had argued that “the evidence I have seen does not establish that Mr. Rodriguez ever knew or had any knowledge the person he allegedly was communicating with was a minor.”

In the days following Rodriguez’s arrest, Miami-Dade Fire Rescue issued the following statement:

MORE NEWS: MDPD: Miami Beach Senior High Teacher Arrested For Engaging In Child Pornography

“Based on the arrest and ongoing criminal investigation, Firefighter Ulises Rodriguez has been relieved of duty. He was hired on July 18, 2005.”