On St. Patrick’s Day, everyone is seeing green—whether it’s the green Chicago River, green beer, green milkshakes or green clothing and bead necklaces. Many might believe that the Emerald Isle and the color green are linked because of the country’s verdant landscape, but the association actually traces its roots to Irish political history.

In fact, blue is believed to have been associated with Ireland before green was. Henry the VIII claimed to be king of Ireland in the 16th century, and his flag at that point would have been blue. That’s at least one reason why a blue flag with a harp is associated with the Irish President. (The harp is one of the two main symbols of Ireland, along with the Shamrock, and it dates back to the bards whose songs and stories were the chief entertainment in medieval Gaelic society.) A light blue became associated with the Order of St. Patrick, an 18th century era order of knights, perhaps to create a shade of blue for the Irish that was different from the royal blue associated with the English, says Timothy McMahon, Vice President of the American Conference for Irish Studies.

McMahon argues the earliest use of green for nationalistic reasons was seen during the violent Great Irish Rebellion of 1641, in which displaced Catholic landowners and bishops rebelled against the authority of the English crown, which had established a large plantation in the north of Ireland under King James I in the early 17th century. Military commander Owen Roe O’Neill helped lead the rebellion, and used a green flag with a harp to represent the Confederation of Kilkenny, a group that sought to govern Ireland and kick out the Protestants who had taken control of that land in the north of Ireland. (They were ultimately defeated by Oliver Cromwell.)

The color green cropped up again during an effort in the 1790s to bring nonsectarian, republican ideas to Ireland, inspired by the American revolution and the French revolution. The main society that promoted this idea, the Society of United Irishmen, wore green, especially an Irish version of the “liberty caps” worn during the French Revolution. One police report described their uniform as comprised of a dark green shirt cloth coat, green and white striped trousers, and a felt hat turned up on one side with a green emblematic cockade.

Though the rest of the uniform eventually faded from popular wear, the importance of the color green spread, thanks in part to the poems and ballads written during this time, most famously “The Wearing of the Green.”

“You start to see different traditions building up around colors — the Protestant tradition is orange, the nationalist tradition associated with the Catholics is green,” McMahon adds.

The origins of the wearing of green clothing in the U.S. on St. Patrick’s Day and for St. Patrick’s Day celebrations in general date back to the 19th century, when waves of Irish immigrants came to America looking for better job opportunities, especially after the Great Famine of the 1840s-50s, and began wearing green and carrying Irish flags along with American flags as a point of pride for their home country.

Write to Olivia B. Waxman at olivia.waxman@time.com.