The story
Its earliest reference is listed in the Random House Historical Dictionary of American Slang as being used by Mary Hallock Foote in Coeur D'Alene in 1894.http://www.randomhouse.com/wotd/index.pperl?date=20001024
Etymology from Wiktionary, CC BY-SA 4.0.