The commander of the base, Lt Gen Robert Cone, told NBC News that, according to eyewitnesses, Mr Hasan had shouted the Arabic phrase "Allahu Akbar!" [God is great] before opening fire.
Mr Obama cautioned against "jumping to conclusions" and said the motives for the shooting were being investigated.