The top US diplomat in Iraq today waded into the US presidential race debate over American troop withdrawals, warning that recent security improvements in the country could be jeopardised by setting an arbitrary timetable for redeployment.

"Over the last year we and the Iraqis have achieved a great deal here and we have both paid a high price for it," Ryan Crocker told the Guardian in an interview. "Certainly my view, sitting here in Baghdad, is that it would be extremely risky to gamble on those gains by moving away from a conditions-based redeployment."

His remarks appeared to be an implicit criticism of promises on troop withdrawals made by the two candidates in the race for the Democratic nomination.

Barack Obama, a consistent opponent of the war in Iraq, has said that if elected president, he would pull all combat troops from the country by the end of 2009. Hillary Clinton, who voted for the war in 2003 and who is now a critic, has said she would establish a plan for withdrawal within 60 days of taking office.

That contrasts with the Republican frontrunner John McCain, who today told CNN that an untimely US withdrawal would bring about "genocide".

"Both senator Obama and Clinton want to set a date for withdrawal. That means chaos. That means genocide," the 71-year-old Arizona senator said.

Ambassador Crocker, who along with Gen David Petraeus has championed President Bush's recent Iraq military strategy, said any decision on troop reductions beyond those already announced would have to be "very carefully evaluated by us and by the Iraqis".

He said: "The troops are already going home. By July 2008 the surge elements will be out of Iraq."

Further than that, he said, "it is very important to keep in mind the principle that has motivated us here, which is withdrawal or redeployments based on conditions.

"There are of course other ways to do this. Simply forget about conditions and set up a timetable and march to that timetable. But I think anyone contemplating that course of action should contemplate very seriously what the consequences would be," he said.

The US defence secretary, Robert Gates, and Gen Petraeus indicated last week that they favoured a pause in troop reductions after this summer to assess the impact on security and stability of the withdrawal of the surge troops.

US commanders in Iraq say that insurgent attacks are down 60% since last June, but violence has been on the increase again in recent weeks.

Crocker said he was "very relaxed" about the March 2 state visit of the Iranian president, Mahmoud Ahmedinijad, to Iraq, the first by an Iranian president since the 1979 revolution. It is some embarrassment to Washington that none of the US allies in the region has so far made such a visit.

"We are more interested in the substance of it, rather than the fact it is taking place," he said. "I think we would all hope that this would be the occasion for Iran to reassess its long-term national security interests with respect to Iraq. I've always believed that a stable, secure democratic Iraq is what Iran would want in the long-term. Not a destabilised society, with chronic security problems, which is what Iran's actual acts on the ground now seem to be aiming at."

Crocker also defended the extended US sanctions imposed by president Bush on Syria this week.

Although US commanders in Iraq have recently spoken of improved cooperation by the Damascus government in stopping the flow of foreign jihadis into Iraq, Crocker said Syria needed to do more.

"It is not something I could describe as a concerted Syrian effort to shut this down completely. A flow continues, and I think we have to consider that it continues with a degree of Syrian complicity. The steps we've announced are intended to push Syrians towards more comprehensive action to shut this off."

He said he had no knowledge of reports that Imad Mughniya, the Hizbullah militant, who was killed in Damascus this week, had been helping organise Shia militias in southern Iraq in 2005.

"But we have established that Lebanese Hizbullah, via Iran, has been involved in for example training of Iraqi operatives. The common link throughout all that in Lebanon, here, and elsewhere, in the region has been Iran and in particular the Iranian Revolutionary Guard's Quds force."