The tradition of making crescent-shaped pastries originates from Arab countries and dates back many centuries. This custom still exists today, as seen in the Algerian tchareke, for example.
The origin of the croissant, according to one of the legends, dates back to late 17th century Vienna, when the city resisted the siege of the Ottoman Empire. The city's bakers prepared a bread with that characteristic shape, the ancestor of the modern croissant, as a mockery of the crescent moon on the Ottoman flag.
The word “croissant” first appeared in the French dictionary in 1863, while the recipe for the first flaky croissant wasn’t published until 1905. The French would make it traditional in their country, especially at breakfast.