Were it not for the war in Iraq, political junkies could have gone to bed early on election night, because by all other indications, President Bush should have been re-elected in a walk. While Democrats point accusatory fingers at those supposedly responsible for their defeat, Republicans should be breathing a huge sigh of relief and pondering the political implications of foreign policy in the Bush administration’s second term.

For all of John Kerry’s campaign rhetoric about the worst U.S. economy since the days of Herbert Hoover, unemployment is relatively low-at 5.5 percent in October 2004, down from a high of 6.3 percent in June 2003, and comparable to the 5.2 percent unemployment rate in October 1996 at the end of Bill Clinton’s first term. Overall economic growth is steady. Inflation and interest rates are low. Home ownership rates are at all-time highs. Those are some of the most popular statistics repeated by the president’s supporters, but they also happen to be true. Those same statistics have proved over time to be the most accurate predictors of an incumbent president’s vote-getting ability. Based on current economic statistics and trusted historical models, Yale economist Ray Fair predicted that Bush would win 56 percent of the 2004 vote.

And yet, despite the modest but measurable improvements in the economy, the president’s popularity has been steadily falling for over three years. From a high point of 86 percent in the immediate aftermath of the 9/11 attacks, his overall job approval-based on the average taken from three different polls-had fallen to 52 percent by October 2003, a whopping 34 point decline. Since March 2004, the president’s overall approval has never exceeded 50 percent. The low point, surprisingly, did not come in the immediate aftermath of the Democratic primaries, when the news was filled with daily verbal attacks on the president’s overall performance, but rather in May, following a wave of violent attacks on U.S. troops by insurgents in Iraq.

Critics of my argument might reasonably contend that numerous other factors, from the economy and jobs, to the budget deficit, to persistent concerns about the burdens of government spending, regulation and taxes, could just as easily explain the president’s lukewarm job approval numbers.

But sentiments toward the war in Iraq coincide closely with the major fluctuations in the president’s approval ratings. The “rally around the flag” effect, whereby citizens lend their support to the commander-in-chief during wartime, has proved fleeting. The two brief upticks in the president’s poll numbers-in March and April 2003 coinciding with the start of the Iraq war, and in December 2003, after Saddam Hussein’s capture-were followed by sharp declines.

As the military expanded its campaign against a rising insurgency inside of Iraq, and as the central justifications for going to war were discredited, fewer and fewer people saw the Iraq war as benefiting the United States.

According to exit polls, 52 percent of voters believed that the war in Iraq has not improved long-term U.S. security. These findings track with earlier surveys, such as the June 2004 poll for NBC News/​Wall Street Journal, which found a slim majority of Americans (51 percent) believing that the military action against Iraq has increased the threat of terrorism against the United States.

The president and his aides successfully convinced a majority of voters that the war in Iraq was directly tied to the war on terrorism. Meanwhile, Senator Kerry’s campaign failed to detail how his strategy, both in Iraq and on terrorism more generally, would constitute a vast improvement over the current state of affairs. Absent a clear choice on the most crucial issue of the campaign, 51 percent of the voters opted to stick with the status quo.

That doesn’t provide much of a governing mandate for a president who desperately needs public support in order to tackle the most urgent problems facing him in a second term.

The president said in his post-election press conference that he has earned political capital and that he intends to spend it. Unfortunately, he is doing that every day in the sands and streets of Iraq.

The war in Iraq nearly cost President Bush the election of 2004. If his plan to shift security responsibilities to the Iraqi government in 2005 falters, the continuing military operations in Iraq may cost him his legacy here at home.