First the Iraqi government gave Senator Barack Obama a boost by seeming to embrace his proposal for a 16-month timetable for withdrawing American troops from Iraq. Now could Senator John McCain, who built his candidacy in large part on his opposition to such a schedule, possibly be following suit?

“I think it’s a pretty good timetable,” Mr. McCain said Friday in an interview on “The Situation Room” on CNN, before adding that it should be based “on the conditions on the ground.”

For months Mr. McCain, the presumptive Republican presidential nominee, has strongly opposed setting a timetable for withdrawal and has criticized Mr. Obama, his Democratic rival, for suggesting one. But the debate has shifted in recent days as Iraqi officials, including Prime Minister Nuri Kamal al-Maliki, moved closer to Mr. Obama’s position.

In the CNN interview, Mr. McCain first seemed to play down any possibility that Mr. Maliki would actually ask the United States to withdraw in the next 16 months to two years. “He won’t,” Mr. McCain said, explaining that he knew Mr. Maliki well.