The United States has cut more than $160m in direct funding for Afghanistan while accusing its government of failing to fight corruption, little over a week before the country’s elections.

Washington has long complained of graft by its ally and the harsh measure comes after Afghan President Ashraf Ghani clashed with President Donald Trump over the US leader’s deal with the Taliban.

“We stand against those who exploit their positions of power and influence to deprive the Afghan people of the benefits of foreign assistance and a more prosperous future,” US Secretary of State Mike Pompeo said in a statement on Thursday.

Pompeo said that the US was suspending work with the Afghan body in charge of monitoring corruption as it is “incapable of being a partner”.

“We expect the Afghan government to demonstrate a clear commitment to fight corruption, to serve the Afghan people and to maintain their trust,” he said. “Afghan leaders who fail to meet this standard should be held accountable.”

Pompeo said the US was taking back $100m committed for a major energy project, saying that Washington would fund it directly rather than sending the money through Afghan authorities. It would also withhold $60m in planned assistance to Afghanistan’s procurement authority.

After 18 years of war and more than $800bn spent in Afghanistan – the biggest chunk on security, including the cost of US forces in the country – this is one of the rare times Washington has withdrawn money from the Afghan government, which is almost entirely dependent on international assistance.

The US will still finish the massive project, Pompeo said, which involves five power substations and a maze of transmission lines in southern Afghanistan.

Afghanistan election

President Ghani stands for re-election on September 28 in the campaign already marred by Taliban violence, with dozens killed this week including in an attack on his rally.

Trump had sought to seal a deal with the Taliban before the Afghan election as part of his goal of ending America’s longest war, launched after the September 11, 2001 attacks.

Ghani had voiced strong concern over a draft deal, under which the US would have withdrawn thousands of troops despite the Taliban’s refusal to negotiate with the internationally recognised government.

Trump, who had controversially invited both the Taliban and Ghani to the US, eventually declared the talks dead, citing an attack by the armed group that killed a US soldier.

Alice Wells, the assistant secretary of state for South and Central Asia, told Congress in a hearing Thursday that the negotiations were “suspended”.