The U.S. is "trapped in Iraq" and the Bush administration needs to time any withdrawal of its troops from the beleaguered country carefully to avoid a deepening of violence there, UN Secretary General Kofi Annan said Tuesday.

"The United States in a way is trapped in Iraq," Annan told reporters at UN European headquarters in Geneva. "It cannot stay and it cannot leave. There are those who maintain that its presence is a problem and there are those who say that if it leaves precipitously, the situation will get worse."

Annan said if U.S. troops leave, the withdrawal "should not lead to a further deterioration of the situation." He said the U.S. should aim to leave when Iraqi authorities are able to create a "reasonable, secure environment" that would prevent violence from spiralling into a full blown civil war.

Annan, set to step down from his post on Jan. 1, 2007, said he regrets not being able to prevent the war in Iraq and that the UN Security Council was not able to convince the U.S. to allow UN weapons inspectors more time to do their work. Annan has been secretary-general for 10 years.

"I firmly believe that the war could have been avoided. The inspectors should have had a bit more time."

Annan said there is no question that Syria and Iran could help to create a more stable Iraq and he welcomed recent talks between Syrian and Iraqi officials about ways to stem the chaos in the country.

On Sunday, Syrian Foreign Minister Walid Moallem arrived in Baghdad and pledged to work with Iraqi authorities. In his first visit to the country since former Iraqi dictator Saddam Hussein was ousted, Moallem called for a timetable for the withdrawal of U.S. forces.

Involvement by other countries in the region is a positive sign, Annan said. "One should not look at it in terms of whether it is helping the United States or multinational forces," he said. "It is their backyard, too, and what is happening in Iraq does have a negative impact on them."

Earlier this year, Annan said he encouraged both Syrian President Bashar Assad and Iranian President Mahmoud Ahmadinejad to "be part of the solution" in Iraq and that he reached both of them by telephone last Saturday.

"If the neighbours who have a role to play could come together and work with the Iraqis to calm the situation it could be positive," he said. "Neighbours can play a positive or a negative role. Neighbours can decide to support one side or the other of the parties in Iraq. They can also decide to work with them to de-escalate."

On Tuesday, Syria and Iraq restored diplomatic relations 24 years after they severed ties. Ahmadinejad, meanwhile, has invited his Iraqi and Syrian counterparts to a weekend summit in Tehran to talk about Iraq. 

With files from the Associated Press