KABUL, Afghanistan (AP) — On the eve of a potentially historic deal with the U.S. and the Taliban to end 18 years of war in Afghanistan, former Afghan President Hamid Karzai welcomed the signing of the agreement, thanked Americans for their generosity, but had harsh words for the U.S. government and military.

“To the American people our message is we are grateful for the help that you gave us in areas where there has been a lot of improvement in Afghan society, together with the rest of the international community,” Karzai told The Associated Press in an interview Friday in the Afghan capital of Kabul . “We understand and respect and admire your good intentions towards us.”

The deal to be signed Saturday in Qatar is to provide for the eventual withdrawal of America's 13,000 troops, as well as for negotiations between the Taliban and the Afghan government and other prominent Afghan leaders.

Karzai was chosen as Afghanistan-s first post-Taliban leader after the U.S.-led coalition in 2001 toppled the hard-line Taliban for harboring al-Qaida chief Osama bin Laden while he planned the 9/11 attacks in the United States.

Karzai ruled until 2014, and during that time his relationship with his U.S. allies soured. He complained often and bitterly about night raids on rural villages carried out by U.S. forces and their Afghan allies hunting Taliban insurgents. He often said it was tactics used by the Americans — and by theirAfghan fighting partners who used American troops to exact revenge — that drovemany Taliban who had returned to their homes back onto the battlefield.

“To the U.S. government, to the U.S. military, we say you were very heavy-handed against the Afghan people. You bombed our villages ... brought immense suffering to the Afghan people,” he said.

“So 18 years on, we have mixed feelings of gratitude to the international community for providing the taxpayers' money to Afghanistan and one of anger at the way we were treated as a people,” said Karzai, his signature long green stripped coat draped over his shoulders.

It's time now for Afghans to take responsibility for their future, he said .

“We we must begin to put our own house in order. We must begin to sit down and talk with one another and find the best ways for our country's future stability and prosperity,” said Karzai. “With U.S. forces leaving Afghanistan, we, the Afghan people must see it as an opportunity for us to take responsibility for our own country and to make it better and to live by our own means. ”