He says the tragedy tears at wounds that are still raw from a deadly mass shooting on the sprawling Army post five years ago.
Obama told relatives of the victims that he's there to honor their loved ones and offer whatever comfort he can.
Officials say Spc Ivan Lopez fatally shot three soldiers and wounded 16 others before killing himself one week ago at the Texas base.
In 2009, another soldier killed 13 people and wounded more than 30 others at the Army post.