In a 1919 opinion, Justice Oliver Wendell Holmes wrote that the First Amendment “would not protect a man in falsely shouting fire in a theatre and causing a panic.” The case in question was not about fires and theaters, but about the legality of opposing the draft. It has been followed by a range of court decisions that offer more precise guidance for drawing the limits of First Amendment protections.
A 1969 decision, for instance, created what's called the “imminent lawless action” test for incitement, ruling that speech that is "directed at inciting or producing imminent lawless action" and is “likely to incite or produce such action” is not constitutionally protected.
The analogy in the Holmes opinion is “a crutch for every censor in America, yet the quote is wildly misunderstood,” a 2012 article in the The Atlantic noted.