WASHINGTON (CNN) -- The next president will have to decide when and how to leave Iraq and what the United States will leave behind, Sen. John McCain said Friday.
Sens. Barack Obama and John McCain trade jabs over each other's economic plans.
Speaking at the first presidential debate, McCain said the war had been badly managed at the beginning but that the United States was now winning, thanks to a "great general and a strategy that succeeded."
"Sen. Obama refuses to acknowledge that we are winning in Iraq," McCain said of his Democratic opponent.
Sen. Barack Obama responded: "That's not true, that's not true."
He blasted McCain as having been wrong about the war at the start, saying McCain had failed to anticipate the uprising against U.S. forces and violence between rival religious groups in the country.
Before moving into foreign policy, the candidates focused on the economy.
McCain said he would consider a spending freeze on everything but defense, veterans affairs and entitlement programs in order to cut back on government spending.
Obama disagreed, saying, "The problem is you're using a hatchet where you need a scalpel.
"There are some programs that are very important that are currently underfunded," Obama said.
He agreed that the government needs to cut spending in some areas, but he said other areas, such as early childhood education, need more funding.
McCain repeated his call to veto every bill with earmarks.
Obama said the country "absolutely" needs earmark reform but said, "the fact is, eliminating earmarks alone is not a recipe for how we are going to get the middle class back on track."
McCain and Obama also tangled over who would cut taxes more. Watch Obama talk about his economic plan »
McCain said he would lower business taxes in order to encourage job growth in the United States, while Obama said he would cut taxes for 95 percent of American families. Watch McCain outline differences between him and Obama »
Obama also said that the United States was facing its worst financial crisis since the Great Depression.
McCain said he was encouraged that Republicans and Democrats were working together to solve the crisis.
The first 30 minutes of the debate focused on the economy, even though the debate was supposed to be centered on foreign policy. The economy has dominated the campaign trail for the past two weeks.
Obama refused to be pinned down on whether he would support a $700 billion plan proposed by President Bush's top economic advisers, saying the final details of the proposal were not yet known.
McCain said he hoped to be able to vote for it.
Just hours ago, the fate of the debate was in limbo because it was unclear whether McCain would show up.
The Republican presidential candidate announced Wednesday that he was suspending his campaign to help forge legislation to save crippled U.S. financial markets.
McCain said he would not attend the debate unless Congress reached an agreement on the bailout package.
McCain said Friday that enough progress has been made for him to attend the debate, even though Congress has not made a deal.
In the final hours before the debate, McCain and Obama separately checked out the stage at the debate site on the University of Mississippi campus.
After their walk-throughs, the candidates went to separate locations for some last-minute debate prep.
Outside the debate site, students and residents in Oxford said they were thrilled -- and relieved -- to find out that the debate was still on. The University of Mississippi said it invested $5.5 million in Friday night's event.
There's a lot on the line for both sides. The election is just weeks away, and polls show Obama and McCain in a tight race.
According to CNN's average of national polls, Obama holds a 5-point lead over McCain, 48 percent to 43 percent. The 9 percent of respondents who are undecided could swing the election either way.
Both campaigns played the expectations game Friday afternoon. Going into debates, campaigns try to lower expectations for their candidates while raising expectations for their opponents. Read more about the expectations
Senior McCain adviser Mike Salter tried to play down the expectations surrounding his candidate, saying McCain wanted only to "do well against a guy who is a pretty good debater, show presidential leadership and be able to speak directly to the American people about what he believes."
The Obama camp, on the other hand, tried to build up the debate as a must-win for the Arizona Republican, arguing that the debate's focus on national security and foreign affairs amounted to a "home field advantage" for McCain.
"If he slips up, makes a mistake or fails to deliver a game-changing performance, it will be a serious blow to his campaign. Given his unsteady performance this week, he desperately needs to win this debate in a big way in order to change the topic and get back to his home turf," Bill Burton, an Obama spokesman, said in a memo.
Obama had contended all along that the debate should go on, saying the financial crisis made it even more important for the public to hear the candidate's views.
The candidates' running mates are not be in Mississippi to watch the debates.
Sen. Joe Biden, Obama's VP pick, is watching the debate from his hotel room in Milwaukee, Wisconsin.
Biden told firefighters and their families at a fish fry in Cudahy, Wisconsin, on Friday that the debate is a "big deal" because it will illustrate a fundamental national security difference between the candidates.
"The fundamental difference between John and Barack and me and John is this: If you're talking about security, it starts at home in addition to protecting our troops abroad and giving them everything they need."
McCain's running mate, Alaska Gov. Sarah Palin, is wastching the debate from Philadelphia, Pennsylvania, where she is preparing for her debate with Biden on October 2 with a cadre of domestic and foreign policy advisers.