Former NFL offensive lineman Jonathan Martin pleaded not guilty to four felony counts and one misdemeanor count in connection with a threatening Instagram post from last month.

Martin surrendered in a Van Nuys, California, court Tuesday on an arrest warrant, according to the Los Angeles District Attorney's office.

Martin faces four counts of making criminal threats and one count of carrying a loaded firearm in a vehicle during an incident on March 13.

Martin, 28, was detained for questioning on Feb. 23 after a threatening image was posted on Instagram that said: "When you're a bully victim & a coward, your options are suicide, or revenge."

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

Another person tagged was James Dunleavy. Martin went to Harvard-Westlake with a James Dunleavy, who is the son of former NBA coach Mike Dunleavy and went on to play basketball at USC.

Harvard-Westlake School, which shut down for a day after the Instagram post, filed a workplace-violence-prevention restraining order against Martin on March 1.

A law enforcement source told KABC-TV in Los Angeles earlier this month that Martin was in a mental health facility.

Martin is due back in court April 25 for a preliminary hearing. If convicted as charged, he faces up to six years in custody.

Martin accused Incognito and Pouncey of bullying him in 2013 when they were teammates in Miami, and it resulted in an NFL investigation. The investigation found that Incognito, Pouncey and John Jerry created a hostile working environment for Martin and others associated with the Dolphins. Martin left the team in the middle of the season.

Martin hasn't played in the NFL since 2015. Weeks after retiring, Martin posted a long message on Facebook explaining that he suffered from depression and had tried to kill himself on several occasions.

ESPN's Kyle Bonagura contributed to this report.