Britain's military will stay in Afghanistan until it can look after its own security, Prime Minister Gordon Brown said Friday, dismissing a call from one of his government's defense aides to begin planning a pullout from the country.

In a major speech on Afghanistan intended to shore up flagging support for the war there and answer critics of his defense policy, Brown was due to tell Britons that "we cannot walk away."

"People ask what success in Afghanistan would look like," Brown said in excerpts released to the media ahead of the speech. "The answer is that we will have succeeded when our troops are coming home because the Afghans are doing the job themselves."

Brown is under increasing pressure to justify the Afghanistan mission to Britons — pressure underscored by the resignation of defense aide Eric Joyce over Brown's management of the conflict. The resignation was particularly embarrassing because Joyce, a former army major, is one of the few members of the governing Labour Party with significant military experience.

In his resignation letter, Joyce called on the prime minister to publicly state when Britain would begin removing its forces from Afghanistan and to do a better job of justifying the war to voters.

"I do not think the public will accept for much longer that our losses can be justified by simply referring to the risk of greater terrorism on our streets," the letter said. "We also need to make it clear that our commitment in Afghanistan is high but time limited."

Brown tried to address both concerns in the speech Friday, rejecting the notion of a time limit and noting that the Afghan mission was not just about protecting Britons, but about protecting the international community as well.

"We all face the same threat," he said.

Support for Britain's engagement is slipping, with critics — including lawmakers on Britain's influential Foreign Affairs Committee — calling the mission too open-ended and its goals too vague.

The government has also been criticized for allegedly failing to provide enough support to soldiers in the field. In another uncomfortable moment for the government earlier this summer, outgoing British minister Mark Malloch-Brown said that forces in Afghanistan needed more helicopters — directly contradicting the prime minister, who insisted the military had all that it needed.

Brown defended his government's record Friday, saying that spending per soldier had more than doubled since 2006.