America has always had a national anthem problem. "The Star Spangled Banner" commemorates a battle no one remembers in stilted and uncolloquial language ("o'er," "ramparts"); worst of all, it has an almost unsingable tune, with octave leaps that few non-professionals can handle gracefully. (Oddly, the tune originally belonged to a drinking song, "To Anacreon in Heaven" – perhaps drunk people were undaunted by its challenges.) No wonder, then, that so many patriotic songs serve as alternative anthems, threatening to replace "The Star Spangled Banner" in our affections. "America the Beautiful," "The Battle Hymn of the Republic," "My Country 'Tis of Thee" – all of them have their place in the repertoire. But in the last century – and especially in the decade since the September 11th attacks – no patriotic song has been as popular as "God Bless America."

The association of "God Bless America" with 9/11 was cemented on the evening of that day, when a group of members of Congress, giving a press conference on the Capitol steps, spontaneously began to sing it. In God Bless America: The Surprising History of an Iconic Song, Sheryl Kaskowitz does some detective work to try to figure out who started the singing and whether it was planned in advance. But even though a surprising number of politicians responded to her questionnaire on the subject, no one can say for sure how the singing began. "The original, spontaneous moment faded from memory," Kaskowitz writes, and what began as a touchingly authentic expression of solidarity became an annual ritual that smacks of politics.

But then, as Kaskowitz shows, questions of authenticity and meaning have always hovered around "God Bless America," in a way that they don't around other patriotic songs. That is partly because "God Bless America" is the most recent entry in the patriotic canon and the only one whose composer is still well known.

Irving Berlin originally wrote the song in 1918, when he was wearing an army uniform during the First World War. He intended it as the finale for "Yip, Yip, Yaphank", the soldiers' revue he was writing while stationed at Yaphank, New York. But while the show went on to be a Broadway smash, Berlin pulled "God Bless America" from the score. "Berlin himself felt that it was 'too obviously patriotic for soldiers to sing,' " Kaskowitz explains.

If "God Bless America" had come out during the First World War, would we still be singing it today, or would it now seem like something from a history museum, like George M. Cohan's "Over There"? It's impossible to say; what's certain is that when the song finally did emerge from Berlin's trunk, in the fall of 1938, it entered a very different historical and cultural moment. The Munich crisis had just passed in Europe, making clear that war with Nazi Germany was only a matter of time. The debate over whether America should engage with the European crisis or isolate itself was at fever pitch.

When the popular singer Kate Smith introduced the song to the world for the first time, in a radio broadcast on November 10, 1938, "God Bless America" seemed to wade directly into the politics of the moment. The tune we all sing today is actually just the chorus of the song; the verse has been all but purged from popular memory. But at the first performance, the national audience heard the verse first, which read:

While the storm clouds gather
Far across the sea,
Let us swear allegiance
To a land that's free,
Let us all be grateful
That we're far from there,
As we raise our voicesIn a solemn prayer.

Presented this way, "God Bless America" sounded like an isolationist plea. It could also be read as a testimony from Berlin, a "grateful" Russian-Jewish immigrant to the U.S., at a time when Jews in Europe were in extreme danger. (The night after the song premiered was Kristallnacht, the nationwide pogrom in Nazi Germany that was a prelude to the Holocaust.) Berlin was famous for giving America secular songs for traditionally Christian holidays – "White Christmas," "Easter Parade." Now he was taking a traditionally secular expression of patriotism and turning it into a "prayer," an invocation of an ecumenical, Judeo-Christian God.

"God Bless America" was an immediate hit. Smith, a big, homey, corny performer, introduced it as a major event: "It's something more than a song – I feel it's one of the most beautiful compositions ever written, a song that will never die," she announced. For the next several months, Smith had exclusive rights to perform the song, which she did every week on her show. To this day, there is a generation of Americans that associates "God Bless America" with Kate Smith's voice. (In a nice use of multimedia, Kaskowitz's book comes with the password for a website that includes clips of Smith's performances, as well as other significant recordings of the song.)

The song's immediate success, Kaskowitz shows, created a few problems for Berlin. He didn't like the way Smith kept expanding her own role in the song's creation myth; he had to keep reminding people that it was not composed as a personal gift to the singer. And while the nation soon took the song to its heart and began singing it at churches, schools, and public gatherings, it remained (and remains today) a copyrighted product. Generously, and with a good eye for public relations, Berlin donated all his profits from the song to the Boy Scouts and Girl Scouts. But it still caused some ill will when people realized they might have to pay to perform what had effectively become a folk song.

Right from the beginning, Americans did battle over the political implications of "God Bless America." Berlin quickly dropped the isolationist verse from the song, and by 1941 he was a prominent interventionist, urging America to get involved in World War II. "God Bless America" became for a time an interventionist anthem, which led certain groups – America First, and the extreme anti-Semitic and pro-Nazi groups on its fringe – to attack both the song and its creator. Kaskowitz has unearthed some of the venomous anti-Semitic sermons and letters that were directed at Berlin's creation, though these remained very much minority voices. From the Left, meanwhile, Woody Guthrie criticized "God Bless America" for its complacent patriotism and piety. "This Land Is Your Land" was written as his rebuke to the song – its original title was "God Blessed America."

The ideological career of the song continued in the Vietnam era, when it became an unofficial anthem of the Right. As Kaskowitz discovers in the archives of The New York Times, it was frequently sung at pro-war rallies and anti-integration marches. The Left, put off by the song's religiosity, was happy to surrender it, preferring its own anthems, such as "We Shall Overcome." It was not until 9/11, Kaskowitz shows, that "God Bless America" became a kind of bipartisan symbol – and a regular feature of Major League Baseball games, to which she devotes her final chapter.

"God Bless America" the book is a fascinating companion to "God Bless America" the song and proves that the biography of a song can be as historically revealing as the biography of a person.

Adam Kirsch is a senior editor at The New Republic and a columnist for Nextbook.org. He is the author of Why Trilling Matters, Benjamin Disraeli, and The Modern Element: Essays on Contemporary Poetry.