After his remarks and the playing of taps, Mr. Obama and first lady Michelle Obama stopped in front of each of the memorials before departing the ceremony. The president placed a commander-in-chief’s coin next to each photo of the fallen.
After the president left, family, friends and colleagues filed slowly past the memorials, many openly weeping.
The president and Mrs. Obama spent time before the speech with families of those killed and with people who were injured during the attack. After his speech, he went to the base hospital to visit wounded people still there.
The ceremony unfolded in a field at the headquarters of the massive post, cordoned off with walls of steel shipping containers. Many soldiers in the crowd listened intently to Mr. Obama’s speech, standing stoically, some with heads bowed.
Sheila Wormuth, whose husband is stationed at Fort Hood, came with her 3-year-old daughter to show their support. While her husband was not at the shooting site, she said, “what happens to my husband’s brothers and sisters happens to us.”
“It means everything to the people that work here. Its the president of the United States,” said Lt. Col. Tommy E. Eberhart.
• This article was based in part on wire service reports.