British troops held up at their base in Basra Palace in the heart of Iraqi's southern city had been described as "sitting ducks" for Shia militia, the Chilcot inquiry heard yesterday.

The inquiry in London questioned top defence and military officials about three controversial events leading to the final withdrawal from Iraq. They were the decision to leave Basra Palace, secret talks with the Mahdi army, a prominent Shia militia, and the Charge of the Knights, a US-led operation with the Iraqi army, drawn up unbeknown to the British in 2008, which crushed most militia activity.

General Sir Peter Wall, deputy chief of the defence staff at the time, was asked by a member of the inquiry panel, Sir Roderic Lyne, whether British troops at the Basra base were "sitting ducks". He replied: "Yup", adding that General Mohan, the Iraqi army commander in Basra, also wanted the British to leave the base as their presence there was "unwelcome for the general security of the environment and the impact it was having on innocent people … essentially, we were attracting a fight to everything we did, whether we were trying to resupply ourselves or go on the offensive or go on framework operations out of Basra Palace".

He added: "We were essentially the focus of the violence."

Wall explained later that he had not indicated that he agreed with the expression "sitting ducks", merely that he acknowledged that description had been used in the past.

Before they left Basra Palace in the autumn of 2007, the British negotiated a ceasefire with the Mahdi army – described at the inquiry yesterday by Jon Day, then policy director at the Ministry of Defence, as a "series of understandings".

The witnesses to the inquiry yesterday said these led to a significant drop in the number of British casualties, enabling the garrison to leave Basra Palace peacefully, and were supported by senior Iraqi political and security officials. However, the deals were criticised at the time by the US, which wanted the British to stay longer.

Sir John Chilcot, the inquiry chairman, suggested on Tuesday, without making it clear, that he planned to hold a session in private about the deal with the Mahdi army. He asked Simon McDonald, Gordon Brown's foreign policy adviser since 2007, whether it would have been possible to withdraw troops from Basra Palace to the city's airport without the ceasefire.

McDonald replied: "Not with the same confidence in not losing men and not suffering bloodshed."

The witnesses were also asked about the Charge of the Knights operation in 2008 which was sprung on the British by Nouri al-Maliki, the Iraqi prime minister, anxious to stamp his authority on Basra.

He did so by sending in troops from Baghdad supported by US forces. British troops were by then encamped at Basra airport, described yesterday by Wall as Mohan's "psychological reserve".

• The headline and text of this article were amended on 7 January 2009. The original heading implied that it was General Wall who described British troops in Basra as sitting ducks. In the text, the name of the inquiry member who used this phrase has been inserted.