George M. Cohan wrote the song in 1906.
June 14th officially became known as National Flag Day in 1949, when President Truman signed an Act of Congress making this designation. Flag Day was officially established by a proclamation of President Woodrow Wilson on May 30, 1916.