An Army psychiatrist who had counseled troops and was upset about being deployed to Iraq opened fire on a crowd of soldiers at Fort Hood Army base Thursday afternoon, killing 12 people and wounding 31, military officials said.

Maj. Nidal Malik Hasan, a U.S. citizen born in Virginia to Jordanian parents, was wounded by a civilian police officer responding to a shooting rampage that is believed to be the worst ever at a U.S. base, said Lt. Gen. Robert Cone, commanding general of Fort Hood.

Hasan was in custody in a local hospital late Thursday. Immediately after the shootings, authorities began trying to determine whether the incident was a coordinated act or the work of a lone gunman. Three other people were questioned but were released, Cone said.

"We believe the evidence indicates it was a single shooter," Cone said late Thursday, adding that despite earlier widespread reports that Hasan had been killed, the alleged gunman's death was "not imminent."

Hasan, 39, is a Virginia Tech graduate who spent six years studying at Walter Reed Medical Center in Washington, D.C., before moving to Fort Hood, according to military records.

Nader Hasan, who described himself to Fox News as a cousin, said Hasan is a Muslim who went into the military against his parents' wishes. Nader Hasan called his cousin a "good American" who never got into trouble but added that he did not support the wars in Iraq and Afghanistan.

"He had always wanted to just get away from the war and (that) environment," Nader Hasan said. "He wasn't someone who even enjoyed going to the firing range.

"We're blown away as a family. We're shocked."

Noel Hamad, Nidal Hasan's aunt, said the family had not talked to Hasan since he arrived at Fort Hood.

"He didn't tell us he was going to deploy. We didn't know," Hamad said in an interview with USA TODAY from her home in Falls Church, Va. "He was trying to get out of the military since 9/11 because they were giving him a hard time," she said, without elaborating.

Fort Hood is home to the 1st Cavalry Division, whose soldiers have deployed multiple times to Iraq. At 339 square miles, it is one of the largest military bases in the world, and has been a focus of the Pentagon's efforts to counter rising wartime stress among troops.

The shootings occurred at Fort Hood's Soldier Readiness Center, where soldiers preparing to deploy overseas go for medical care and other duties. In an adjoining auditorium, 600 people had gathered to celebrate the college graduation of 138 soldiers, Cone said. When the shooting began, soldiers closed the doors to the auditorium to prevent the shooter from entering, he said.

Base officials locked down the base and began a building-by-building search across the fort that continued more than six hours after the shootings, said Hilary Shine, spokeswoman for the city of Killeen, which abuts Fort Hood.

Most of the dead and wounded are soldiers, Cone said. Two civilians were among the wounded.

Cone said he could not rule out terrorism but said the evidence "doesn't suggest that." He said he did not know whether the gunman had shot randomly or targeted certain people or units.

Ten of the shooting victims were taken to Scott and White Health System in nearby Temple. All arrived with gunshot wounds, said hospital spokesman Glen Couchman. He said four were in surgery late Thursday. The other six were in the emergency room and all would wind up in intensive care, he said.

He said hundreds of people had answered the hospital's request for blood donations immediately after the shootings.

President Obama cut short his speech at the White House Tribal Nations Conference and consulted with Pentagon officials about the shooting.

"It's difficult enough when we lose these brave Americans in battles overseas," the president said. "It is horrifying that they should come under fire at an Army base on American soil."

He called it "a horrific outburst of violence" and said his administration will work for "answers to every single question."

Former president George W. Bush, whose ranch in Crawford, Texas, is about 20 miles from the perimeter of Fort Hood, said in a statement, "Laura and I are keeping the victims and their families in our thoughts and prayers during this difficult time."

A disgruntled doctor

Hasan was born in Virginia and graduated from Virginia Tech university, according to The Roanoke Times archives.

He later received two degrees from the Uniformed Services University of the Health Sciences in Bethesda, Md., according to Hasan's military record and a university newsletter.

U.S. Rep. Michael McCaul, a Republican from Austin, was briefed by military officials and said Hasan had taken some unusual classes for someone studying about mental health.

"He took a lot of extra classes in weapons training, which seems a little odd for a psychiatrist," McCaul said.

McCaul said Hasan had received poor grades for his work at Walter Reed and was not happy about his situation in Fort Hood, where Hasan apparently felt like "he didn't fit in."

"He's disgruntled because he had a poor performance evaluation, he doesn't believe in the mission, he's looking at getting transferred to Afghanistan or Iraq," McCaul said. "He's not happy about all that."

McCaul added that officials planned to interview Hasan to try to determine for sure that he was not working with foreign agents.

"From an intelligence standpoint, that's key, finding out if he talked to anyone overseas," McCaul said.

Hasan had come to the attention of federal law enforcement officials at least six months ago because of Internet postings that discussed suicide bombings and other threats, according to a federal law enforcement official who spoke to The Associated Press on condition of anonymity because he was not authorized to discuss the case.

The official said investigators were trying to confirm that Hasan was the author of the postings, one of which was a blog that equates suicide bombers with a soldier throwing himself on a grenade to save the lives of his comrades. One of the officials said federal search warrants were being drawn up to authorize seizure of Hasan's computer.

'It's just nerve-racking'

Soldiers and others described a chaotic scene at the base.

Sirens wailed as Tammy Biggers, wife of an Army specialist deployed in Iraq, huddled in her locked house, fielding phone calls from family and friends while sending text messages to her daughter at the local high school.

"Now I can't even get a hold of her. The cellphones are jammed. I can't even send a text," Biggers said. "They still have us on lockdown. I'm just staying right beside my computer with the news on and praying."

The basewide siren and announcement system, usually used to warn of tornadoes, instructed base residents to seek shelter, lock their doors and turn off the air-conditioning. Biggers had been outside her house with their chihuahua when she heard the first sirens.

"Down here you don't think a lot about sirens. It could be a training exercise," she said. Then came the orders to seek shelter. "It's just nerve-racking."

"It is crazy to see it happen on your home turf," said Army Sgt. Dominic Moes, 28, from Boyne City, Mich. "You don't really expect it at all, especially soldier-to-soldier. It's pretty shocking."

Moes was among hundreds of soldiers waiting outside the base, which had been locked down for hours. Dozens of cars were lined up at the gate, going nowhere.

"A lot of us deal with the stress but it's something else to hurt another soldier," said Moes, who said he has deployed to Iraq three times. "These are the guys we confide in. A lot of these soldier are as close to me as my own family."

Specialist David Straub, from Ardmore, Ala., waited in a line of cars to re-enter Fort Hood. He said he had twice deployed and was proud that both times they "came back with everybody."

"Now this happens," Straub said. "I feel like I've been stabbed in the back."

'Everything's locked down'

The shooting also rattled the city of Killeen, near the sprawling base.

About 15 children remained after hours at the Miles Ahead day-care center because parents were unable to leave the post when it was sealed off, said Tanisha Laws, 35, a cook at the center.

"You don't know who is who or what is what," Laws said.

There was only one customer inside the normally busy Henderson's Family Restaurant in Killeen.

"It's dead right now because everything's locked down," said cashier Kelly Kuehnle, 43. "It's a very oppressive atmosphere. Everybody's devastated."

Beauty salon owner Chemar Jones said she and three employees spent a nerve-wracking afternoon holed up in the Killeen salon with the front and doors locked. Jones was worried about her cousin, a medic with the military police on Fort Hood, who she tried multiple times to reach without success.

Shine, the Killeen spokeswoman, said she was "immediately reminded" of the 1991 massacre at the Luby's cafeteria in the city in which 23 were killed.

"Our community is restless and worried," Shine says. "Because a lot of people have family and friends working at Fort Hood, I know many are wondering if the victims are people they know. Unfortunately, for some, that is going to be true."

By Sharon Jayson and Dan Reed, USA TODAY>>