Kabul: Outgoing Afghan President Hamid Karzai used his farewell speech on Tuesday to take a parting shot at the United States, accusing Washington of waging a war against Taliban insurgents for its own ends.

Karzai rose to power with American support in 2001 after the ousting of the Taliban regime, but he has often criticised the US military campaign that has struggled to defeat the Islamist insurgency that engulfed the country.

He will step down next week after a 13-year reign that has seen only limited improvements in infrastructure, health, education and women’s rights despite billions of dollars of aid.

“This is not our war, it is a foreigners’ war, it is based on their goals,” Karzai told government officials as he bid them goodbye at the presidential palace in Kabul.

“America didn’t want peace ... America should be honest with Afghanistan. What they say and what they do should be the same.”

Karzai has a long record of anti-American rhetoric, and has previously accused the US of colluding with the Taliban — sparking outrage from the US, which has suffered 2,350 military deaths in Afghanistan since 2001.

“My advice to the next government is to be very careful with America and the West. We can be friends with them, but we want equal benefits,” Karzai said.

Karzai’s relationship with Washington plunged to a new low last year when he decided not to sign a bilateral security deal (BSA) to allow some US troops to stay in Afghanistan beyond this year on a training and support mission.

His successor Ashraf Gani is likely to sign the deal shortly, after vowing he would while on the campaign trail.

Under the deal, about 12,000 US-led Nato troops will remain in Afghanistan into 2015 after combat operations finish this year.

Gani and his poll rival Abdullah Abdullah struck an agreement Sunday to form a “unity government”, ending months of disputes over who was the rightful winner of the fraud-tainted June 14 presidential election.