Britain could withdraw funding for Afghanistan's security forces if the Afghan government fails to tackle the country's huge corruption problems, the outgoing British ambassador to Kabul has warned in a valedictory interview with the Guardian.

When foreign combat troops leave in 2014 Afghanistan will still be an impoverished and unstable state and the government will not be able to pay the army and police until huge mines start large scale production in several years time, Sir William Patey said. The security forces are the country's main bulwark against a "descent into chaos", he said.

But there are concerns corruption is now so rampant it threatens the legitimacy of the government, which Transparency International rates as one of the most corrupt in the world, behind only Somalia and North Korea.

"Nobody thinks that [Afghanistan] will be self-sustaining before 2024 or 2025 … when the mineral resources that are currently being developed, and the future mineral resources, begin to kick in with revenues," he said in his office in the heart of Kabul's heavily-fortified diplomatic quarter. "If something is not done about corruption in the long term, then there would be a very strong argument that says you would be throwing good money after bad," the ambassador said.

"And while we obviously want to maintain the state here, if the Afghans themselves are not prepared to make an effort, the British people will take a different view on this."

The west has spent billions of dollars fighting the Taliban-led insurgency on the grounds it is critical to deny safe haven to al-Qaida and similar groups, and has pledged continued cash support for Kabul to pay for security and development when soldiers leave. Asked if a cut-off of funds could include UK contributions to the estimated $4.1bn a year needed to support the security forces, Patey said it could, "in a worse case scenario".

He added: "Some Afghans may think we have no choice, because we have predicated this as a national security issue. Our preferred choice is to promote a stable, democratic Afghan state, but it's not our only choice, it's not the only way we can protect our national security."

Years of fighting and investment had contributed to a basic level of government stability that had made Patey optimistic about the western mission, however, despite corruption worries.

"Afghanistan doesn't have to be a model state for us to succeed, but it does have to be a state capable of governing itself, capable of resisting international terrorism, and we don't want it to return to an ungoverned space, or governed by a system that is completely hostile to us," he said.

"I actually think we are on the path and those sacrifices that have been made will not be in vain."

But, speaking just days after the massacre of 16 Afghan civilians by a US soldier, he also admitted that western soldiers could overstay their welcome.

This month's killings of mostly women and children came on top of a series of other damaging revelations, including a video showing US Marines urinating on what appeared to be the corpses of Taliban fighters, and the discovery US troops had burned copies of the Qur'an on Bagram airbase.

With more than 100,000 foreign troops still in Afghanistan he warned there were almost certain to be more cases of individual misconduct that were damaging to the wider mission.

"I absolutely expect there will be something else, you cannot have this many troops, this many people in Afghanistan and not cause offence or come up against the acts of individuals, who cause offence, so we will have more of it," he said.

Civilian casualties are probably the issue that most angers Afghan president Hamid Karzai, who has long criticised western leaders for their failure to prevent them. His government's failure to combat corruption in turn is a major western concern.

"[There is] not enough leadership from the top on the subject beyond statements and rhetoric," Patey said.

Most prominently prosecutors have yet to make significant progress on the case of Kabul Bank, a lender with ties to the family of Karzai and his first vice-president that nearly collapsed and has since been described by Western officials as a virtual Ponzi scheme.

Nearly $900m is missing, and while the two main suspects have officially been detained, they live under a loose form of house arrest and have been spotted travelling around Kabul and enjoying meals at hotels and high-end restaurants, according to the New York Times.

"Kabul Bank is so symbolic, because it's two people who have been caught, bang to rights, they've been caught red-handed," said Patey.

"All the rest remains allegations and suspicions, so that's why it's a kind of litmus test. If you won't do these ones, what chance the rest?"

Hanging on the wall outside Patey's office is a map of the British retreat at the end of the first Anglo-Afghan war in 1842. It serves as an understated reminder of the lessons of history, although he thinks the best clue to handling the current turmoil lies not in Britain's bloody 19th century mistakes, but the descent into a vicious civil war in the 1990s.

Mohammad Najibullah, president when Soviet troops withdrew in 1989, survived for several years without their firepower; it was only when funds dried up that his government fell, Patey points out.

"It was when the money was taken away and he couldn't pay his armed forces that led to the collapse into civil war. And indeed if the Afghans were unable to sustain their army and police force, why wouldn't we see a descent into chaos?"

"That's why I say it's absolutely vital that we continue to play our part … which will be increasingly financial."