Exclusive Details

Ex-NFL player Jonathan Martin -- who was at the center of the Miami Dolphins bullying scandal -- has been detained by police ... after he allegedly posted a disturbing photo of a gun, ammo and the names of ex-NFL teammates.

The post first appeared on Martin's Instagram account -- showing an image of a shotgun surrounded by ammunition with the caption, "When you're a bully victim & a coward your options are suicide, or revenge."

He also listed social media handles for ex-Dolphins teammates Richie Incognito and Mike Pouncey.

Martin also posted the name of his former high school -- Harvard Westlake -- one of the most exclusive private schools in the country.

Harvard Westlake closed the school in the wake of the threats -- telling students to stay off-campus in an abundance of caution.

Law enforcement tells TMZ Sports ... "The individual we believe to be responsible for the social media post has been detained and the investigation is ongoing."

Martin famously accused Incognito and Pouncey of physically and emotionally abusing him during his stint on the Miami Dolphins in 2013.

The players claimed they were just harmlessly hazing Martin.