Origin of "don't yell 'help!', yell 'fire!'"

Pretty funny if true, that this actually predates (and in fact only makes sense) prior to the industrial revolution. As whenever I’ve encountered this “fact” the subtext has been how awful, jaded and crime ridden “modern” (as in later 20th/early 21st century) cities are.