In 1924 the oath's wording was changed slightly (the original "my flag" became "the flag of the United States of America"). Officially recognized by the government in 1942, the pledge became compulsory in some public schools, but the following year the Supreme Court ruled (in West Virginia State Board of Education v. Barnette) that recitation could not be required of any individual. It continues, however, to be mandatory or recommended in a majority of the states and is a daily fixture in most American classrooms. The final alteration to the pledge occurred in 1954 when, by a joint order of Congress, the words "under God" were inserted. The change is usually ascribed to a cold-war attempt at differentiating the United States from officially atheistic Communist countries. The addition caused little stir when it was enacted, but in 2002 opposition to it resulted in a federal appeals court ruling that the words are unconstitutional because they violate the First Amendment's prohibition against government endorsement of religion. The Supreme Court subsequently overturned the verdict on procedural grounds.
See J. W. Baer, The Pledge of Allegiance: A Centennial History, 1892-1992 (1992).