The bagel originated in Central Europe, probably in Poland. A 1610 document from Krakow mentions "beygls" given as a gift to women in childbirth. This is often cited as the earliest known reference to the bagel, but the document is not clear what a "beygl" is; it may be what is now known as a bagel, it may be something related to the word for stirrup "beugal", or something else the meaning of which is lost to history.
An often repeated story says that the bagel originated in 1683, originated by a Jewish baker from Vienna (whose name seems never to be mentioned) who created them as a gift to King Jan Sobieski of Poland to commemorate the King's victory over the Turks that year. The baked good was fashioned in the form of a stirrup to commemorate the victorious cavalry charge. That the name bagel originated from "beugal" (stirrup) is considered plausible by many both from the similarites of the word and due to the fact that traditional hand made bagels are not perfectly circular but rather slightly stirrup shaped. More prosaically, the name may simply originate from the Yiddish word "bugel" or the German word "bugel", meaning a round loaf of bread.
The bagel was brought to New York City by immigrants in the 1880s where it continues to flourish. Until the 1920s it was rare in other parts of the United States other than a few cities with large Eastern European Jewish communities. The bagel came into much more general use throughout North America in the last quarter of the 20th century.
In the late 20th century many variations on the bagel with different types of doughs and other foods and seasonings added to the dough flourished. The bagel sandwich (with a sliced bagel substituting for the two slices of bread) also became common.