Picture yourself at 8 years old, just having crossed the finish line of an egg-and-spoon race one step behind the winner. A spectator pats you on the shoulder and, shaking her head, says, “Close, but no cigar.” Never having heard the phrase before, you assume the first-place finisher will soon be off somewhere smoking their hard-earned stogie.

Since cigars aren’t customarily given to children as rewards or for any other reason, the spectator in this imaginary situation was surely using the phrase as a way to convey that you came really close to success but didn’t quite get there. In the early 20th century, however, the cigar in question was a literal one.

Before stuffed animals became the gold standard for carnival prizes, people often competed to win cigars at shooting ranges and for other target-related games. As Barry Popik explains on his blog The Big Apple, carnival barkers would shout “Close, but no cigar!” to anyone who fell just short of clinching the coveted reward.

Revelers try to knock down coconuts during this "coconut shy" game at a London fair in 1922.Hulton Archive/Getty Images

“You begin investing a penny in three rings, which you endeavor to throw in such a way as to land them round the handle of a knife stuck into the wall,” Robert Machray wrote in his 1902 book The Night Side of London. “But—but you don’t succeed. ... Another penny—and this time you accept defeat, and move on to the next stall, where another penny gives you the privilege of trying to roll three balls into certain holes with numbers attached thereunto. Should you score twenty you will win a cigar. But you do no more than score nine.”

By the late 1920s, “Close, but no cigar” had started showing up outside fairs and carnivals. A Long Island Daily Press article from May 1929 titled “Close; But No Cigar” described an unlucky New Yorker named Hugo Straub who was “believed to have set a world’s record in the business of getting-defeated-for-the-presidency” because he “finished second in no less than two presidential races within one week.”

Maybe Straub treated himself to a high-quality cigar (or two—one for each loss) as a consolation prize.

[h/t The Big Apple]