The United States, Mr. McCain added, “maintains a military presence there, but a much smaller one, and it does not play a direct combat role.”

During his primary battle, Mr. McCain accused his rival Mitt Romney of setting a timetable for withdrawing troops from Iraq, even though Mr. Romney was merely speaking generally about timetables that might be set in private discussions among Iraqi and American leaders. Since then, Mr. McCain himself has come under repeated fire from the Democrats for his support of the war and for offhand comments that he could envision a United States peacekeeping presence in Iraq for 100 years.

Despite his mention of a specific year for the end of American combat operations, Mr. McCain and his aides strenuously argued afterward that his remarks should not be interpreted as promoting a timetable for withdrawal, even implicitly, and that he was simply projecting victory. “I am certainly not putting a date on it,” Mr. McCain said with exasperation during a circular, semantic debate in the back of his campaign bus.

Mr. McCain took issue when a reporter said the candidate had asked everyone to go along on a “magic carpet ride” to 2013. “I don’t think it has anything to do with fantasy,” Mr. McCain said pointedly. “I think it has everything to do with setting goals and achieving.”

In Afghanistan by 2013, Mr. McCain predicted in his speech, intelligence will have led to the capture or death of Osama bin Laden. In addition, Mr. McCain forecast, the threat from the Taliban will have been “greatly reduced”; there will be no place in the world that Al Qaeda can consider a safe haven; and “there still has not been a major terrorist attack in the United States since Sept. 11, 2001.”