Prime Minister Gordon Brown warned Afghanistan's government on Friday to take action against corruption, saying he would not risk more British lives there unless it reforms.

Brown said in a speech that success in Afghanistan is vital to Britain's security — but declared that if the Afghan government does not mend its ways it will forfeit the world's support.

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

Brown's ultimatum echoes the words of President Barack Obama, who said Wednesday that he told newly re-elected Afghan President Hamid Karzai that "this has to be a point in time in which we begin to write a new chapter" in Afghanistan.

The U.K. leader's speech comes after the deaths of seven British soldiers in the past week, including five who were shot by an Afghan police officer they were training. Corruption-marred presidential elections and rising casualties have undercut support for the war — and increased pressure on Brown to justify Britain's presence in Afghanistan.

Public support has eroded in countries trying to stabilize Afghanistan, something a top NATO general has warned could undermine allied efforts.

"The clock in Afghanistan is clearly running against us," said German Gen. Egon Ramms, whose Allied Joint Forces Command oversees NATO's force in Afghanistan. "In the end, politicians will not go against their public opinion."

Increasing violence in the country is also threatening the U.N. mission there. On Thursday, the world body said it was temporarily relocating more than half of its international staff while it looks for safer accommodation, following an attack last week on a guesthouse in which five staff members were killed.

Karzai has repeatedly promised to work to clean up his government. Corruption is deeply rooted in Afghanistan, a country awash in drug money, and where bribes are a part of everyday life.

Karzai's spokesman Humayun Hamidzada said that Afghan and international officials needed to work together to counter corruption.

"The President has renewed his committment in fighting this menace by redoubling his government's efforts," Hamidzada said. "But fighting corruption requires closer and more effective cooperation between the government of Afghanistan and the international community."

A March report by the U.S. Agency for International Development found that corruption had reached "an unprecedented scope in the country's history." Transparency International, a non-governmental organization, last year ranked Afghanistan 176th out of 180 countries on its corruption perceptions index, a poll that assesses the degree to which corruption is perceived to exist among public officials and politicians.

Brown acknowledged that the government in Afghanistan had become a by-word for corruption, but noted that Karzai had assured him that he would take decisive action against it.

"International support depends on the scale of his ambition and the degree of his achievement in five key areas: security, governance, reconciliation, economic development, and engagement with Afghanistan's neighbors," he said. "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."

Brown linked military action there to safety on Britain's streets.

"We will not be deterred, dissuaded or diverted from taking whatever measures are necessary to protect our security," Brown said.

Britain currently has about 9,000 troops in the country, the majority in the restive southern Helmand province. The force is the second-largest foreign one in the country after the United States. Germany, the third-largest contributor to the NATO-led force, has some 4,300 troops in the country.