Many staples of American cuisine originated outside the United States. German immigrants brought over the modern hamburger, and Italians were the first to combine cheese with macaroni. Apple pie—a dish that commonly follows the words “American as”—has a reputation for being one of the rare dishes the country can fully claim. But as it turns out, the history of the iconic American dessert isn’t so simple.

The earliest known recipe for apple pie comes not from America, but from England. It dates from the late 1300s and lists multiple fruits as the ingredients, including figs, raisins, and pears, as well as apples. Unlike a modern pie, there was no added sugar, and it was baked in a “coffin” pastry crust meant to contain the filling rather than serve as an edible part of the dish. Though the first concoction resembling apple pie may have come from England, the recipe itself wasn’t wholly English. Its influences can be traced back to France, the Netherlands, and the Ottoman Empire.

Apple trees had only been cultivated in Britain for several centuries by this point. An early ancestor of the fruit originally sprouted up in the Tien Shan mountains of Kazakhstan millions of years ago and was later cultivated in Central Asia before spreading across the globe. Before apple pie could take over America, someone first had to plant the right apple trees on the land. The only apples native to North America prior to British colonialism were crab apples. When colonists arrived in Jamestown, Virginia, in the 17th century, they brought with them the Old World seeds and cuttings they needed to make cider, creating new varieties of American apples.

U.S. residents enjoyed apple pie throughout the 18th and 19th centuries, but it didn’t gain its all-American status right away. The dessert’s transition from British import to American classic may have started during the Civil War. In his book Apple Pie: An American Story, author John T. Edge describes Union and Confederate soldiers scavenging for apples and raiding the hearths and flour bins on farms to make pies. The memory of the sweet treat during a time of national turmoil may have “fixed the taste of apple pie on the palate of generations to come,” Edge writes.

The patriotic symbolism surrounding apple pie was fully established in the early 20th century. A 1902 New York Times article kicked off a new era for the dish, dubbing it “the American synonym for prosperity.” The Times may also be responsible for creating the myth that apple pie is an American invention. A 1926 headline from the paper read: “The Tourist Apple Pie Hunt Is Ended: American Army Abroad Has Failed Again to Find in Europe ‘the Kind They Make at Home.’”

The dish's patriotic popularity continued to rise. A 1928 New York Times article called First Lady Lou Henry Hoover's homemaking skills “as American as apple pie.” Several years later, fighting “for mom and apple pie” became a common slogan among World War II soldiers. During the Second World War, apple pie was linked to a certain image of domesticity and the perfect American housewife.

Apple pie may not be 100 percent American in origin, but very few foods are. Many of the most iconic American dishes include contributions from various cultures and parts of the world. Apple pie—with its Asian apples, Middle Eastern wheat, and European recipe—is no exception.