An Army psychiatrist facing deployment to one of America’s war zones killed 13 people and wounded 30 others on Thursday in a shooting rampage with two handguns at the sprawling Fort Hood Army post in central Texas, military officials said.

It was one of the worst mass shootings ever at a military base in the United States.

The gunman, who was still alive after being shot four times, was identified by law enforcement authorities as Maj. Nidal Malik Hasan, 39, who had been in the service since 1995. Major Hasan was about to be deployed to Iraq or Afghanistan, said Senator Kay Bailey Hutchison, Republican of Texas.

Clad in a military uniform and firing an automatic pistol and another weapon, Major Hasan, a balding, chubby-faced man with heavy eyebrows, sprayed bullets inside a crowded medical processing center for soldiers returning from or about to be sent overseas, military officials said.

The victims, nearly all military personnel but including two civilians, were cut down in clusters, the officials said. Witnesses told military investigators that medics working at the center tore open the clothing of the dead and wounded to get at the wounds and administer first aid.

As the shooting unfolded, military police and civilian officers of the Department of the Army responded and returned the gunman’s fire, officials said, adding that Major Hasan was shot by a first-responder, who was herself wounded in the exchange.

In the confusion of a day of wild and misleading reports, the major and the officer who shot him were both reported killed in the gun battle, but both reports were erroneous.

Eight hours after the shootings, Lt. Gen. Robert W. Cone, a base spokesmen, said Major Hasan, whom he described as the sole gunman, had been shot four times, but was hospitalized off the base, under around-the-clock guard, in stable condition and was not in imminent danger of dying.

Photo

Emergency personnel removed a wounded person from Fort Hood after a rampage left 13 dead and 28 wounded.Credit
WFAA

Another military spokesman listed the major’s condition as critical. The condition of the officer who shot the gunman was not given.

Major Hasan was not speaking to investigators, and much about his background — and his motives — were unknown.

General Cone said that terrorism was not being ruled out, but that preliminary evidence did not suggest that the rampage had been an act of terrorism. Fox News quoted a retired Army colonel, Terry Lee, as saying that Major Hasan, with whom he worked, had voiced hope that President Obama would pull American troops out of Iraq and Afghanistan, had argued with military colleagues who supported the wars and had tried to prevent his own deployment.

As a parade of ambulances wailed to the scene of the shootings, officials said the extent of injuries to the wounded varied significantly, with some in critical condition and others lightly wounded. General Cone praised the first-responders and the medics who acted quickly to administer first aid at the scene.

“Horrible as this was, I think it could have been much worse,” the general said.

The rampage recalled other mass shootings in the United States, including 13 killed at a center for immigrants in upstate New York last April, the deaths of 10 during a gunman’s rampage in Alabama in March and 32 people killed at Virginia Tech in 2007, the deadliest shooting in modern American history.

As a widespread investigation by the military, the F.B.I., and other agencies began, much about the assault in Texas remained unclear. Department of Homeland Security officials said the Army would take the lead in the investigation.

A federal law enforcement official said the F.B.I. was sending more agents to join the inquiry. On Thursday night, F.B.I. agents were interviewing residents of a townhouse complex in the Washington suburb of Kensington, Md., where Major Hasan had lived before moving to Texas.

Photo

Sgt. First Class Noe Figueroa was among the many soldiers stranded outside the base after the shooting.Credit
Jim Young/Reuters

Mr. Obama called the shootings “a horrific outburst of violence” and urged Americans to pray for those who were killed and wounded.

“It is difficult enough when we lose these men and women in battles overseas,” he said. “It is horrifying that they should come under fire at an Army base on American soil.”

The president pledged “to get answers to every single question about this horrible incident.”

Military records indicated that Major Hasan was single, had been born in Virginia, had never served abroad and listed “no religious preference” on his personnel records. Three other soldiers, their roles unclear, were taken into custody in connection with the rampage. The office of Representative John Carter, Republican of Texas, said they were later released, but a Fort Hood spokesman could not confirm that. General Cone said that more than 100 people had been questioned during the day.

Fort Hood, near Killeen and 100 miles south of Dallas-Fort Worth, is the largest active duty military post in the United States, 340 square miles of training and support facilities and homes, a virtual city for more than 50,000 military personnel and some 150,000 family members and civilian support personnel. It has been a major center for troops being deployed to or returning from service in Iraq and Afghanistan.

The base went into lockdown shortly after the shootings. Gates were closed and barriers put up at all entrance and exit checkpoints, and the military police turned away all but essential personnel. Schools on the base were closed, playgrounds were deserted and sidewalks were empty. Sirens wailed across the base through the afternoon, a warning to military personnel and their families to remain indoors.

Military commanders were instructed to account for all personnel on the base.

“The immediate concern is to make sure that all of our soldiers and family members are safe, and that’s what commanders have been instructed to do,” said Jay Adams of the First Army, Division West, at Ford Hood.

General Cone said the shooting took place about 1:30 p.m., inside a complex of buildings that he called a Soldier Readiness Processing Center. The type of weapons used was unclear, and it was not known whether the gunman had reloaded, although it seemed likely, given that 43 people were shot, perhaps more than once.

Photo

Credit
The New York Times

All the victims were gunned down “in the same area,” General Cone said.

As the shootings ended, scores of emergency vehicles rushed to the scene, which is in the center of the fort, and dozens of ambulances carried the shooting victims to hospitals in the region.

Both of the handguns used by Major Hasan were recovered at the scene, officials said. Investigators said the major’s computers, cellphones and papers would be examined, his past investigated and his friends, relatives and military acquaintances would be interviewed in an effort to develop a profile of him and try to learn what had motivated his deadly outburst.

Major Hasan was assigned to the Darnall Army Medical Center at Fort Hood.

The weapons used in the attack were described as “civilian” handguns. Security experts said the fact that two handguns had been used suggested premeditation, as opposed to a spontaneous act.

Rifles and assault weapons are conspicuous and not ordinarily seen on the streets of a military post, and medical personnel would have no reason to carry any weapon, they said. Moreover, security experts noted, it took a lot of ammunition to shoot 43 people, another indication of premeditation.

It appeared certain that the shootings would generate a whole new look at questions of security on military posts of all the armed forces in the United States. Expressions of dismay were voiced by public officials across the country.

The Muslim Public Affairs Council, speaking for many American Muslims, condemned the shootings as a “heinous incident” and said, “We share the sentiment of our president.”

The council added, “Our entire organization extends its heartfelt condolences to the families of those killed as well as those wounded and their loved ones.”

News of the shooting set off panic among families and friends of the base personnel. Alyssa Marie Seace’s husband, Pfc. Ray Seace Jr., sent her a text message just before 2 p.m. saying that someone had “shot up the S.R.P. building,” referring to the Soldier Readiness Processing Center. He told her he was “hiding.”

Ms. Seace, 18, who lives about five minutes from the base and had not been watching the news, reacted with alarm. She texted him back but got no response. She called her father in Connecticut, who told her not to call her husband because it might reveal his hiding place.

Finally, 45 minutes later, her husband, a mechanic who is scheduled to deploy to Iraq in February, texted back to say that three people from his unit had been hit and that a dozen people in all were dead.

By late afternoon, the sirens at Fort Hood had fallen silent. In Killeen, state troopers were parked on ridges overlooking the two main highways through town. In residential areas, the only signs of life were cars moving through the streets. In the business districts, people went about their business.

In 1991, Killeen was the scene of one of the worst mass killings in American history. A gunman drove his pickup truck through the window of a cafeteria, fatally shot 22 people with a handgun, then killed himself.

Fort Hood, opened in September 1942 as America geared up for World War II, was named for Gen. John Bell Hood of the Confederacy. It has been used continuously for armor training and is charged with maintaining readiness for combat missions.

It is a place that feels, on ordinary days, like one of the safest in the world, surrounded by those who protect the nation with their lives. It is home to nine schools — seven elementary schools and two middle schools, for the children of personnel. But on Thursday, the streets were lined with emergency vehicles, their lights flashing and sirens piercing the air as Texas Rangers and state troopers took up posts at the gates to seal the base.

Shortly after 7 p.m., the sirens sounded again and over the loudspeakers a woman’s voice that could be heard all over the base announced in a clipped military fashion: “Declared emergency no longer exists.”

The gates reopened, and a stream of cars and trucks that had been bottled up for hours began to move out.

Reporting was contributed by Michael Brick from Fort Hood, Tex., Michael Luo from New York, and David Stout from Washington.

A version of this article appears in print on November 6, 2009, on page A1 of the New York edition with the headline: 12 KILLED, 31 WOUNDED IN RAMPAGE AT ARMY POST; OFFICER IS SUSPECT. Order Reprints|Today's Paper|Subscribe