Outgoing Afghan President Hamid Karzai used his farewell speech Tuesday to take a parting shot at the United States, accusing Washington of waging a war against Taliban insurgents for its own ends. (Wakil Kohsar/Agence France-Presse via Getty Images)

Afghan President Hamid Karzai slammed the United States during his farewell address Tuesday, saying the U.S. war effort had failed to make Afghanistan peaceful.

Karzai, who will be replaced by President-elect Ashraf Ghani on Monday, accused the American government of spending the past 13 years focused on “its own interests” instead of what was best for the Afghan people.

“We don’t have peace because Americans didn’t want peace,” Karzai told a gathering of several hundred Afghan government employees.

“If the U.S. wants Afghanistan to be a good friend, it needs to match its words with actions,” Karzai later added.

Since the fall of the Taliban in 2001, when the NATO coalition installed Karzai in office, more than 2,000 U.S. soldiers have been killed in Afghanistan and about $100 billion in U.S. tax money spent rebuilding the country. Karzai did not mention that commitment, prompting a rare rebuke from U.S. Ambassador James B. Cunningham.

In a meeting with Western reporters Tuesday evening, Cunningham called Karzai’s remarks “ungracious and ungrateful.”

“His remarks, which were uncalled for, do a disservice to the American people and dishonor the sacrifices that Americans have made here . . . and continue to make,” Cunningham said.

In an interview, Karzai spokesman Aimal Faizi said Karzai has repeatedly stressed that he appreciates what U.S. troops and taxpayers have done to try to help Afghanistan.

But Faizi said Karzai strongly believes that the U.S. government hasn’t been aggressive enough in confronting Pakistan over “insurgent sanctuaries” on its territory. Karzai also believes that the United States, working in conjunction with Pakistan, “sabotaged” the Afghan government’s efforts to reach a negotiated peace with the Taliban, Faizi said.

“The president believes, and the Afghan public believes, ‘This is not our war, and this war has been forced upon us,’ ” Faizi said. “The president’s focus over the last 13 years has been to stop this war, which is not ours, and to do that we had a successful war strategy . . . but those points were never taken seriously by the U.S. government.”

The latest public split between Karzai and the U.S. government seemed a fitting end to Karzai’s 13 years in office. Though U.S. officials credit him with keeping Afghanistan intact despite a continued Taliban insurgency, relations between the countries have soured dramatically since President Obama took office in 2009.

Karzai has lobbed terse statements at the U.S. military over civilian casualties during U.S. military operations. Karzai also refused to sign a long-term security agreement allowing U.S. troops to remain in the country after this year.

The tension has made U.S. leaders eager for Karzai’s departure, which was finalized over the weekend when Ghani and the second-place finisher in the Afghan election, Abdullah Abdullah, agreed to form a unity government. Both have pledged to immediately sign the security agreement, which will allow the United States to keep nearly 10,000 troops in Afghanistan next year.

Sharif Hassan contributed to this report.