THE Prime Minister today defended Britain's military mission in Afghanistan, saying that the 9,000-strong UK force forms our first line of defence against terror attacks at home and insisting "we cannot, must not and will not walk away".

But he warned newly re-elected Afghan president Hamid Karzai that his administration will have forfeited its right to international support if it fails to root out corruption and improve the governance of the country.

The warning came in a hastily-arranged speech at the end of a bloody week for the British force in Afghanistan, with seven deaths, including the murder of five servicemen by a rogue Afghan police officer they were training.

Meanwhile, a former armed forces chief told the House of Lords that the Government had failed to provide adequate numbers of helicopters to prevent the loss of British lives in Afghanistan.

Former chief of defence staff Lord Guthrie said: "There is a clear need for more helicopters... I have no doubt whatsoever that with additional helicopters, some of these lives which have been lost would have been saved."

Speaking to an audience of high-ranking military officers in London, Mr Brown said Afghanistan's government has become a byword for corruption. And he acknowledged flaws in the disputed election which led to the president winning a second term in office earlier this month.

"I am not prepared to put the lives of British men and women in harms way for a government that does not stand up against corruption," he said.

His spokesman said this should not be seen as a threat to pull Britain's force out if Mr Karzai fails to reform his government, telling reporters in Westminster: "We have no intention of withdrawing troops from Afghanistan until we have completed our campaign."

The spokesman said Mr Brown was committed to succeeding and was sending a message to the international community that we will succeed or fail together - and we will succeed.

In three phone conversations since his re-election - the most recent yesterday morning - Mr Karzai accepted the need for action on five key areas: security, governance, reconciliation, economic development and engagement with its neighbours, said the spokesman.

It is expected that the Afghan president will set out his plans to meet these goals in his inauguration speech on November 19, and Mr Brown made clear that international support depends on the scale of his ambition and the degree of his achievement.

"If, with our help, the new government of Afghanistan meets these five tests, it will have fulfilled an essential contract with its own people. And it will have earned the continuing support of the international community, despite the continuing sacrifice," said the Prime Minister.

"If the government fails to meet these five tests, it will have not only failed its own people, it will have forfeited its right to international support."