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.
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.
More From This Section
"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.
Under the deal, about 12,000 US-led NATO troops will remain in Afghanistan into 2015 after combat operations finish this year.
Ghani 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.