"We are going to get to the bottom of this, and we are going to get through this," Obama said.
Rep. Gabrielle Giffords, D-Ariz., was shot in the head at a political event in a Tucson Safeway, but was recovering after surgery. Police said six people were dead and 18 were wounded.
As for Giffords, Obama said, "She is currently at a hospital in the area and she is battling for her life."
Among the dead were U.S. District Chief Judge John Roll and a 9-year-old child.
"We are still assembling all the facts," Obama said at the White House. "We don't know yet what provoked this unspeakable act."
A suspect was in custody, but police have released few details about him.
The president praised Giffords as an outstanding public servant, adding, "Gabby Giffords was a friend of mine. … It's not surprising that Gabby was doing today what she always does, she was listening" to her neighbors and her constituents.
"I ask all Americans to join me and Michelle in including all the victims, including Gabby, in our thoughts and our prayers," Obama said " … I am hopeful she is going to pull through."
The president said his heart goes out to the families of those killed.
"It is a tragedy for Arizona and a tragedy for our entire country," the Obama said.
Obama added he had been in touch with Arizona Gov. Jan Brewer to offer the "full resources of the federal government." He said he sent FBI Director Robert Mueller to Tucson to help coordinate the investigation.