The Montana ruling came in the prosecution of David Joseph Lenio, who posted tweets threatening to kill children and/or Jews. The posts cited by the prosecutors included the following (from an earlier Volokh Conspiracy post):
Even animals without money get land to live on, hunt & forage; but Americans without dollars must be homeless? I want to shoot up a school
USA needs a Hitler to rise to power and fix our #economy and i’m about ready to give my life to the cause or just shoot a bunch of #kikes …Lenio was prosecuted under two statutes -- Montana's law prohibiting intimidation and threats (Mont. Code sec. 45-5-203(1)) and its criminal defamation statute (Mont. Code sec. 45-8-212), which includes among its prohibitions "[d]efamatory matter is anything that exposes... a group, class, or association to hatred, contempt, ridicule, degradation, or disgrace in society ..."
Lenio challenged the constitutionality of both statutes. The court ruled against him regarding the intimidation statute, meaning that the prosecution may proceed. But the court agreed with Lenio's argument regarding the criminal defamation statute, holding that it was unconstitutional because it applies to groups so large that which particular, individual harm cannot be shown; does not require actual malice in cases involving matters of public concern; and allows for punishment of speech that is protected by the First Amendment.
The prosecutor could appeal, but the Montana court's decision is just the latest of several decisions in recent years striking down criminal defamation laws.