FORT BRAGG, N.C. — President Obama observed the end of the war in Iraq on Wednesday before an audience of those who fought in it, telling a crowd of returning war veterans that the nearly nine years of conflict in Iraq, a war now indelibly imprinted on the national psyche, had come to a close.

“As your commander in chief, and on behalf of a grateful nation, I’m proud to finally say these two words,” Mr. Obama told a crowded hangar at this famed North Carolina army base that is home to the 82nd Airborne Division: “Welcome home.”

Calling it a “historic moment,” Mr. Obama, who has over the years of his presidency had his ups and down with his own military leaders, if not the enlisted men and women, infused his remarks with far more accolades for the military than the usual few that he dispenses to local politicians at the beginning of most of his standard speeches.

This time, he thanked the “legendary” 82nd Airborne Division. He thanked senior enlisted leaders. And the Sky Dragons of the 18th Airborne Corps. And the Special Operations Forces. And military families. In fact, the president wrapped himself in all of the storied patriotism and history of the country’s armed forces, congratulating the assembled troops for the job they did in Iraq — a war which he himself never approved.