Former Miami Dolphins offensive lineman Jonathan Martin will avoid prison time after reaching a plea deal Friday on charges related to a threatening post on his Instagram account in February 2018.

As part of the agreement, three felony charges against Martin will be dropped in two years if he attends scheduled psychotherapy sessions, alcohol counseling and psychiatric appointments.

The image on the post showed a shotgun and ammunition and tagged four accounts, including those belonging to former Dolphins teammates Richie Incognito and Mike Pouncey. It also included hashtags for Harvard-Westlake, where Martin went to high school in the Los Angeles area, and the Dolphins.

A prosecutor said the people named in the post supported the plea deal’s terms.

At the time of the social media post, Martin, 29, was detained for questioning and released, a spokesman for the Los Angeles Police Department told . Nine days before the post, a gunman killed 17 people at a high school in Parkland, Florida.

Martin accused Incognito and Pouncey of bullying him in 2013, when they were teammates in , which resulted in an investigation. The investigation found that Incognito, Pouncey and John Jerry created a hostile working environment for Martin, who left the team in the middle of the season.

The suspended Incognito for eight games after the investigation was completed.

Martin hasn’t played in the since 2015.