Afghan President Ashraf Ghani visited the Pentagon on Monday to thank and honor American service members for their support during the 14-year military mission that has cost billions of dollars and taken the lives of 2,215 U.S. troops.

Flanked by high-ranking U.S.officials in a chilly Pentagon courtyard and speaking to an audience that included some family members of U.S. troops killed in combat in Afghanistan, Ghani said he came "to say thank you on behalf of a grateful nation to the people in this building and in the larger U.S. community for sacrificing continuously since Sept. 11 to bring us freedom and hope."

Ghani's visit comes on the eve of a historic meeting at the White House on Tuesday that is likely to result in a renewed U.S. military commitment to Afghanistan and an official slowing of the force drawdown plan for the next two years.

Ghani expressed gratitude for the U.S. troops who made "the ultimate sacrifice" as well as the more than 20,000 American service members who were wounded in action.

"But also to more than hundreds of thousands with double duties, close to a million American service men and women have gotten to know my country. You have been in the most remotest valleys, and the highest peaks, and the parched deserts, and beautiful valleys, but also in most demanding situations," Ghani said.

"Each one of you has left a legacy, but I also understand that Afghanistan has marked you. When you wake up at night, sometimes you're not sure whether you're back there or here, but what gratifies me as the president of Afghanistan is what I've had the honor to hear repeatedly from American veterans: 'I have left a piece of my heart in Afghanistan,' " he said.

"You were not there just to fight. ...You built schools, you built dams, you build roads, and while the physical infrastructure is great and it's changed lives, it is the attitude that you brought with it — an attitude of caring, and attitude of discipline and sacrifice," he said. "The Afghan people, but particularly the Afghan security forces, honor that attitude."

Ghani also thanked "the American taxpayer."

"The men and women, you, all of you, will make your hard-earned dollars available for Afghanistan. And because of that, the government of national unity ... is committed to account for every single one of those dollars," he said.

Ghani is urging the U.S. to expand its long-term military commitment to Afghanistan. His visit is the culmination of a dramatic revival of the U.S. relationship with Afghanistan that had deteriorated severely under the previous president, Hamid Karzai.

Karzai, who left office last year, appeared at times to be aggressively anti-American despite the massive U.S.-led military support that kept him in office. He made that military mission more difficult by demanding an end to "night raids" by foreign troops. He once suggested that the U.S. and the Taliban were secretly allied and conspiring against him.

Last year he stubbornly refused to approve the bilateral security agreement that extended the presence of U.S. troops into this year, despite widespread popular support for the deal.

About 10,000 U.S. troops are in Afghanistan. Officials say the new withdrawal plan will not require force levels to fall to about 5,000 by the end of this year, a milestone that President Obama committed to in May 2014 when he laid out a schedule for ending the 14-year mission.

The result will give U.S. military commanders more flexibility as they work toward the goal of bringing nearly all U.S. troops home by the time Obama leaves office in January 2017.

The top commander in Afghanistan, Army Gen. John Campbell, will be able to keep a larger force into 2016, potentially into the spring and summer fighting season.