WASHINGTON (CNN) -- Nearly seven years after September 11, Sens. John McCain and Barack Obama each now must try to convince voters that they are the best choice to keep the country safe.
Sen. John McCain has tried to paint his opponent as weak on national security and defense.
Both campaigns are beginning to ramp up their rhetoric. While McCain tries to paint Obama as soft on national security and Obama tries to characterize his opponent as merely staying the course that President Bush has set, there are certain realities they both have to face.
On day one in office, the most pressing security challenge may not be Iraq. The war there is going better, for now.
But the greater worry for a new administration? It may be the war against al Qaeda in Afghanistan and Pakistan -- and the threat posed by Iran's nuclear program.
The candidates still differ greatly on Iran. Obama advocates talking to the regime. Watch more on the candidates' differences »
"I will do everything in my power to prevent Iran from obtaining a nuclear weapon. That starts with aggressive, principled diplomacy without self-defeating preconditions," Obama said at the annual conference of the American Israel Public Affairs Committee, an influential pro-Israel lobbying group, on June 4.
McCain wants more economic sanctions.
"Rather than sitting down unconditionally with the Iranian president or supreme leader in the hope that we can talk sense into them, we must create the real-world pressures," McCain said at the same meeting.
On fighting al Qaeda in Afghanistan and Pakistan, the candidates have separate takes.
"If we're going to catch [Osama] bin Laden or, most importantly, break down al Qaeda ... we've got to have the capacity to put more troops in Afghanistan," Obama said May 13.
In fact, Bush has promised NATO that the U.S. will send thousands of troops next year. There are rising worries that militants are using the Pakistan-Afghanistan border region as a haven to plot new attacks.
McCain has focused on the need to train more Afghan troops and use counterinsurgency tactics already honed in Iraq. But in a speech last month, he envisioned the ultimate success after a first McCain term of office, suggesting this outcome: "The government of Pakistan has cooperated with the U.S. ... The increase in actionable intelligence that the counterinsurgency produced led to the capture or death of Osama bin Laden and his chief lieutenants."
But the reality both men may find is that Iraq still hangs over everything. Rhetoric aside, they know that on day one in office, military commanders will recommend keeping enough troops on the ground to get the job done, however many troops that might be.
For now, with more than 150,000 troops tied up there, finding enough to deal with any next crisis may be the ultimate challenge for the next president.
And the debate over troop levels and retention rates recently came up over a Senate bill that would expand education benefits for veterans. Watch more about the new bill »
It has become a flash point in the early sparring between McCain and Obama. Some Republicans admit that the Democrats may have outmaneuvered them on the issue.
McCain has defended his opposition to the bill that would expand education benefits for veterans, saying it would hurt the military that he hopes to lead. Watch more of McCain's opposition to the bill »
The bill, which passed the Senate 75-22 in late May, would expand education benefits for veterans who served at least three years in the military after the September 11 attacks.
McCain, a former Navy officer and prisoner of war during Vietnam, says the bill would hurt military retention by 16 percent and be a disincentive for service members to become noncommissioned officers, which he called "the backbone of all the services."
Democrats cite the Congressional Budget Office, whose figures say the expanded benefits would boost enlistment by 16 percent.
"I think John McCain has been outmaneuvered," said GOP strategist Ed Rollins, who had served as former Arkansas Gov. Mike Huckabee's presidential campaign chairman. "Sometimes in politics, there are intellectual issues and emotional issues."
"John McCain is going against veterans groups; he is going against a constituency that should be his. ... But I think he is on the wrong side of this issue," Rollins said. "A lot of Republicans are voting for this, and I think to a certain extent, as it moves forward, there will be more and more. There will be tremendous pressure from veterans groups past and present, and I think you will see a lot of bipartisan support for this as well."
Obama has repeatedly tried tie McCain to Bush by noting that both of them oppose the GI Bill expansion.
"I revere our soldiers and want to make sure they are being treated with honor and respect," Obama said in Puerto Rico on May 24. "I think the GI Bill is one way for us to do that, and I hope that John McCain and George Bush decide they believe the same thing." Watch Obama blast McCain, Bush on veterans »
Obama hasn't served in the military.
"It is really probably Barack Obama's shining moment in this campaign. The way he phrased this debate, the way he framed the issue," said Robert Zimmerman, a Democratic superdelegate.
"Intellectually, John McCain may be right; the president may be right. Emotionally, you are on the wrong side; you can never win an emotional battle in an intellectual argument," Rollins added.
McCain, along with Sens. Lindsey Graham of South Carolina and Richard Burr of North Carolina, has introduced an alternative bill that would increase education benefits on a sliding scale based on an individual's years of service.
The GI Bill was created in June 1944, when President Franklin D. Roosevelt signed into law the Servicemen's Readjustment Act of 1944. It was designed to help educate and train military veterans returning from World War II. According to the Department of Veterans Affairs, 7.8 million of 16 million troops who served in World War II received educational or vocational training from the GI Bill.
CNN's Ed Hornick contributed to this report.