After recent court cases, many Americans know that the phrase "under God" was added to the Pledge of Allegiance in the 1950s. But do you know who wrote the pledge, when and -- perhaps more important -- why?

Richard J. Ellis didn't. So the politics professor at Willamette University in Salem, Ore., decided to research it, and the result is "To the Flag: The Unlikely History of the Pledge of Allegiance," published in April. Here are some of the surprising things he learned:

The Pledge of Allegiance is 113 years old. It was written in 1892 by Francis Bellamy to celebrate Columbus's discovery of America and the country's public school system.

Bellamy and James B. Upham worked for Youth's Companion, a Boston-based, nationally circulated magazine. Their descendants have argued about who wrote the pledge, but Ellis said the evidence clearly shows it was Bellamy, a former Baptist minister with an interest in Christian socialism. Upham came up with the original pledge salute.

The original salute began with a military gesture, the right hand, palm down, raised to the right eyebrow. Then, at the words, "to my flag," the right hand was raised skyward, with the palm up. Over time, people didn't turn their palms up and, by the 1940s, the gesture looked a lot like a Nazi salute. Congress changed it in 1942.

The pledge was tied to a movement to fly the American flag over every public school. Before 1892, flags were scarce on school grounds. The Grand Army of the Republic, a group of Northern Civil War veterans, launched a public school flag drive and cooperated with Youth's Companion as the magazine gave away flags and promoted the National Columbian Public School Celebration.

Flying the flag and reciting the pledge were slower to catch on in the South, Ellis said, because of hard feelings about the Civil War. "The flag was still a contested symbol in the South," he said.

Anxiety about immigration also prompted the pledge. The United States had long been a melting pot, but the 1880s saw a surge in immigrants, especially from countries in Southern and Eastern Europe. Bellamy, who traced his own family to Bethlehem, Conn., in the 1700s, and many other Americans worried that these "new" immigrants did not have the same education and skills of those from Northern European countries and that most of them were Roman Catholic or Jewish.

"The hard, inescapable fact is that men are not born equal," Bellamy wrote.

Other motivations for the pledge included anxiety about creeping materialism that critics saw threatening patriotic ideals, and a desire to stress the unity of the country, promoted by Northern veterans of the Civil War, which had ended just 27 years before the pledge was written.

There were other pledges. Several circulated before World War I, including this one, a variation on a pledge by George Balch and recited in a San Francisco school: "We turn to our flag as the sunflower turns to the sun. We give our heads and our hearts to our country. One country, one language, one flag."

The pledge has been edited several times. National flag conferences, attended by veterans and patriotic groups in the 1920s, changed the phrase "my flag" to "the flag of the United States" and, a year later, inserted the phrase "of America," because they worried that immigrant children were pledging allegiance to the flags of their homelands, either "out of ignorance or deviously," Ellis said. Bellamy didn't like the changes, arguing that they destroyed the cadence of the original version.

Bellamy died in 1931 and didn't live to see Congress add "under God" to the pledge in 1954 as an antidote to godless communism. His son, Ellis said, argued against editing what had become an "American classic."

Kindergartners and their teacher, Stephanie Herndo, recite the Pledge of Allegiance at Townsend Elementary in Del City, Okla. The pledge was written in part to celebrate public schools.