An army psychiatrist about to be sent to Iraq gunned down 13 people and wounded 30 in a rampage on a huge Texas military base but survived after being shot four times himself.
Major Nidal Malik Hasan, who his family said had been harrassed because of his Muslim faith and was "mortified" at the prospect of going to Iraq, fought for his life in intensive care at the Fort Hood base as army investigators on Friday pieced together the motives for the massacre.
Fort Hood, one of the biggest military bases in the world, was in lockdown and was to hold a day of mourning a day after the officer trained his guns on his colleagues.
Another officer shot him four times to end the killings and was herself wounded.
Hasan, 39, opened fire with two non-army issue pistols at a medical processing center for troops being deployed from Fort Hood to Iraq and Afghanistan, officials said.
Fort Hood commander Lieutenant General Bob Cone said one of the guns was a semi-automatic weapon, which "might explain the rate of fire that he apparently obtained."
Cone said that Hasan had acted alone. The gunman was blocked from reaching a graduation ceremony attended by some 600 people, close to the scene of carnage.
Hasan was "not currently speaking to investigators," Cone said.
"As horrible as this was, it could have been much worse," the commander said as he praised the rapid reaction to the shootings. The first-responder was shot by Hasan but survived and managed to take him down. Related article: Obama reax
Most of the victims were military personnel and many were taken to a local hospital, which put out an urgent call for blood donations as streams of wounded poured into its emergency rooms.
Shock and dismay hung over the military community after the killings.
"I can't imagine that anyone could have seen this coming," said Mary Keller, president and chief executive of the Military Child Education Coalition, which helps youths cope with life in the armed forces.
The central Texas base was locked down for several hours as the shocked community searched for a possible motive.
After interviewing over 100 people at the scene, authorities appeared to have ruled out the possibility of a second shooter.
Hasan was a military psychiatrist who dealt with troops returning from combat and faced his own imminent deployment.
The shooter's cousin said the major was "mortified by the idea of having to deploy" and that Hasan had been harassed by other soldiers for being a Muslim, particularly since the September 11, 2001 attacks.
"He wanted to do whatever he could within the rules to make sure he wouldn't go over," Nader Hasan told The New York Times, adding that his cousin had retained a lawyer and sought to get out of the army before the end of his contract. Related article: Shooter faced harassment
The major was born in the United States to Palestinian parents who had moved from a small town near Jerusalem, Nader Hasan added.
A surveillance video aired by CNN showed the major wearing traditional Arab garb at a convenience store on the base just hours before the shooting as he purchased coffee and hashbrowns.
A Virginia Tech University graduate, Hasan had worked at the Walter Reed Army Medical Center in Washington and obtained his medical degree from the Uniformed Services University of the Health Sciences in Bethesda, Maryland.
President Barack Obama, who had been kept informed as the rampage was tracked in the White House situation room, denounced the "horrific outburst of violence" and urged Americans to pray for those killed and wounded.
"It's difficult enough when we lose these brave Americans in battles overseas," he said. "It is horrifying that they should come under fire at an army base on American soil."
The US Senate held a moment of silence in somber acknowledgement of the rampage.
The shooting spree dealt a new blow to an American military already under severe strain from repeated combat tours during years of war in Iraq and Afghanistan and plagued by a rise in suicides and depression.
Obama is considering whether to accede to a demand from his war commander in Afghanistan for tens of thousands more troops to be deployed there to fight the Taliban.
Fort Hood, which houses tens of thousands of soldiers and civilians, has also shouldered some of the nation's biggest burdens. The stress of repeated deployments to America's two wars also has the base posting the highest number of suicides at US military bases -- 75 since 2003. Facts: Fort Hood
The base's 1st Calvary Division, some 15,000 soldiers, is currently deployed to Iraq. Fort Hood has suffered the highest casualties of any US military base there.