Kabul's attempt to impose the penalties triggered outrage in the US, which has provided billions of dollars of civil support and military assistance to Afghanistan since the Taliban regime was ousted in 2001.
Huge volumes of US hardware are being transported home, and the Afghan government had insisted that US forces pay USD 1,000 for each shipping container lacking what it called valid customs forms.
But Abdul Qadir Jelani, spokesman for the Afghan finance ministry, told AFP that the government and US-led NATO forces had "reached an agreement after a series of discussions".
"NATO forces have assured the Afghan government that they will process their customs documents according to the law."
More From This Section
Nearly two weeks ago, Afghanistan announced that it was owed USD 70 million in unpaid customs fees and fines on the withdrawal of US equipment. Border crossings were blocked for a short time due to the dispute.
NATO's International Security Assistance Force confirmed the deal, saying Afghanistan had agreed to scrap its demand for cash.
"This agreement provides our forces with the freedom of movement necessary to effectively support our Afghan counterparts as they secure the Afghan people," commander General Joseph Dunford said in a statement.
US defence officials said that the row had forced the military to fly out cargo at vast extra cost rather than using road crossings into neighbouring Pakistan and Uzbekistan.
As the NATO exit looms next year, the US and Afghanistan have been caught in a series of spats over stalled peace talks with the Taliban and the control of jails holding suspected insurgents.
US Congress was warned in May by the special inspector general for Afghanistan reconstruction that Kabul was exacting exorbitant customs fees and taxes in violation of previous agreements.