Lt Gen Bob Cone said the shooter had been killed in the incident and two suspects arrested. All were American soldiers. The base is locked down.
Lt Gen Cone said the motive for the shooting was not known. One of the dead was a policeman, others were soldiers.
President Barack Obama described it as "a horrific outburst of violence".
US media reports have named the gunman as Major Malik Nadal Hasan. He was reportedly in his late 30s or early 40s and due to be sent on a mission to Iraq.
Speaking at a press conference in Washington, President Obama said: "It is difficult enough when we lose these brave men and women abroad, but it is horrifying that they should come under fire at an army base on US soil."
Mr Obama said the White House was working with the Pentagon, FBI and Department of Homeland Security to make sure Fort Hood was secure.
Fort Hood, near the town of Killeen, is the largest US base in the world.
Lt Gen Cone said the shooting had begun at about 1330 (1930 GMT) at a personnel and medical centre at Fort Hood, where soldiers who are preparing to deploy go for last-minute medical check-ups.
He said the shooter, who had two handguns, had opened fire and "due to the quick response of the police forces, was killed".
Two more suspects were apprehended in an adjacent facility, he said, adding that some eyewitness accounts suggested there might have been more than one shooter.
A serviceman stationed at Fort Hood who asked to remain anonymous told the BBC: "I heard the emergency announcement over the speakers outside and saw people rushing to get indoors.
"In our office we're okay but we're hearing about the deaths. It's horrible and very shocking.
"We are still on lockdown. I am hearing that at least nine people may be dead. This is so terrible and frightening."
Hilary Shine, of the Killeen Fire Department told,
"It has schools, a hospital, a convenience store even. And it has a large daytime population - including civilians working on the base - with as many as 80,000 in this area during the daytime."
Local congressman John Carter, speaking to NBC News, said gunfire had erupted half an hour before a graduation ceremony was due to begin.
Texas Senator Kay Bailey Hutchison said in a statement: "I am shocked and saddened by today's outburst of violence at Fort Hood that has cost seven of our brave service members their lives and has gravely injured others.