Giving evidence to the Iraq Inquiry in London, John Jenkins said that the establishment of democracy was not a “done deal”.

He said that the presence in the Iraqi Army of many senior officers with a background in Saddam Hussein’s Baath Party continued to represent a “risk”.

Nevertheless, he insisted that the current situation in the country was much better than had appeared likely in the years immediately following the invasion of 2003, when it descended into violence.

“If you look at the history of Iraq, the history of military coups in Iraq, you have to think that that is always a possibility – a real possibility – in the future.

“But I think where we are at the moment is much better than we thought it was going to be back in 2004/05.”

He said that there was a widespread belief in Iraq that Baathist elements were behind recent bomb attacks in the country.

“There is clearly a balance to be drawn between using the professional competence and experience of former army officers under Saddam to provide the backbone of the modern Iraqi security forces and dealing with the suspicions and fears of others that this is the reintroduction of irreconcilable elements of the Baath Party,” he said.

The inquiry was also told that plans were drawn up for an emergency pull-out of British troops last year amid fears that the legal basis for their presence could collapse.

Peter Watkins, director of operational policy at the Ministry of Defence, said there had been concerns that negotiations with the Iraqi Government would not be completed in time.

An agreement was only finalised on December 23 after progress was held up by the protracted discussions between the Iraqis and the Americans.

The inquiry was adjourned until Monday.