Gordon Brown last night sought to head off growing speculation over an early British exit from Iraq, insisting troops still had "an important job to do".
In a letter to Liberal Democrat leader Sir Menzies Campbell, the Prime Minister rejected calls to set out a timetable for withdrawal.
He said the military had "clear obligations to discharge", and it was wrong to say the continued presence of more than 5,000 personnel would "achieve little".
"Decisions on UK force levels and posture in Iraq are dictated by conditions on the ground," Mr Brown added.
Attacks on British forces in southern Iraq have been intensifying in recent months, with insurgents seeking to portray an expected withdrawal to an airbase outside Basra as an humiliating retreat.
Commentators have increasingly voiced concerns about the UK's ability to sustain intense military campaigns in both Iraq and Afghanistan.
There have been repeated claims that UK forces are actually exacerbating the situation in southern Iraq, where sectarian factions are regarded as on the verge of civil war.
Mr Brown was responding to a letter from Sir Menzies in which he repeated demands for a reappraisal of Government strategy in Iraq and Afghanistan, insisting the level of casualties were now "unacceptable".
The message from the Premier is likely to be seen as an effort to reassure those who fear that Britain is wavering in its commitment to military operations - particularly among the US administration.
"It is wrong to say that the continuing presence of UK forces in Iraq will achieve little, or that they are severely restricted in what they can do," Mr Brown wrote.
"UK forces in Basra continue to have the capability to strike against the militias and provide overall security.
"They will continue to work with the Iraqi authorities and security forces to get them to the point where they can assume full responsibility for security."
He added: "I am determined that our approach to Iraq should be based on the principle that we will fulfil our obligations to the government and people of Iraq and the United Nations."
"These obligations are set out in United Nations resolutions. That is why I reject your approach of a predetermined exit timetable that would undermine our international obligations, as well as hindering the task of our armed forces and increasing the risks they face."
Mr Brown insisted that decisions on the ground would be made "on the basis of advice from our military and other experts, taking fully into consideration the safety of our armed forces".
"I will do nothing that puts at risk the ability of our armed forces, who have done and are doing a magnificent job, to accomplish their work."
Mr Brown also delivered a staunch defence of policy in southern Afghanistan, where British forces are sustaining the highest casualties in any campaign since the Second World War.
The Royal Anglians have suffered some of the heaviest losses of any unit since their tour of duty in Helmand province began five months ago, with nine soldiers killed and many more injured.
Meanwhile, a UN report published yesterday showed that the opium poppy crop in Afghanistan had hit record levels, despite the presence of Nato troops.
Mr Brown said he did not dispute that the operations involved "tough, dangerous and difficult tasks and terrain".
"But as in Iraq I will strongly defend the integrity, bravery and intelligence with which UK commanders and forces are taking forward the strategy they have developed."
He added: "The international community is united in its desire to prevent Afghanistan once again becoming a failed state...
"There is much to do, but progress will be measured across a wide range of activity - covering governance, reconstruction, economic development and the building up of local security forces."
Sir Menzies said it was clear that Mr Brown's approach in Iraq was no different to his predecessor Tony Blair's - despite efforts to present it differently.
"The Prime Minister's letter simply rehearses the Government line and could have been written by his predecessor," he said.
"But the reality on the ground and the views of senior military figures undermine Mr Brown's analysis.
"The debate on this issue will not go away, particularly as the American presidential elections will put Iraq at the centre of American politics."
"It should now be put to the top of Britain's agenda."Reuse content