1:05 PM PT -- A spokesperson for the L.A. District Attorney's Office tells us ... "Today, a judge granted Jonathan Martin mental health diversion without objection for two years that includes outpatient, weekly individual psychotherapy sessions, weekly alcohol counseling and bimonthly consultation with a licensed psychiatrist."
"If he complies with those terms and otherwise does not commit any other significant criminal offenses, the court will dismiss the charges."
Jonathan Martin just cut a deal with L.A. prosecutors ... and now, the ex-NFL O-lineman could get out of his gun and knife threats case without spending more time behind bars.
Martin -- who famously alleged he was bullied by ex-teammate Richie Incognito during their playing days with the Dolphins -- made some scary comments on social media that led to his arrest in 2018.
In an Instagram post, Martin threw up a picture of a shotgun with shells ... and wrote, "When you're a bully victim & a coward your options are suicide, or revenge."
Hours later ... cops say they found Martin with a cache of weapons including a loaded shotgun, knife and an ax -- and say he had been threatening classmates for years.
Prosecutors eventually hit Martin with 5 charges ... 4 counts of making criminal threats and 1 count of possessing a loaded firearm.
But, TMZ Sports has learned Martin cut a deal in court Friday ... and will enter a 2-year pre-trial diversion program.
The specifics about Martin's program are unclear -- but typically, when offenders complete a diversion program, the charges are wiped from their record.
Typical diversion programs include completing treatment courses, counseling, community service, restitution, etc.
30-year-old Martin started 32 games in his NFL career before ultimately getting cut from the Panthers in 2016.
Originally Published -- 11:30 AM PT