In this courtroom sketch, Maj. Nidal Malik Hasan sits in court for his court-martial Tuesday in Forth Hood, Texas. Hasan is representing himself against charges of murder and attempted murder for the 2009 attack that left 13 people dead at Forth Hood. (ASSOCIATED PRESS / Brigitte Woosley)

FORT HOOD, Texas (AP) — Maj. Nidal Malik Hasan fired the last of 146 bullets in his assault on Fort Hood, then walked outside where he met two civilians who asked about the commotion and the laser-sighted pistol in his hand.

Hasan told one person not to worry. He assured the other it was just a training exercise and the gun shot only paint. He let both live.

But moments earlier, dozens of uniformed soldiers received no quarter from Hasan, prosecutors said Tuesday as the Army psychiatrist’s long-delayed trial began in a Texas military courtroom.

With his life hanging in the balance, Hasan made little effort to defend himself. Acting as his own attorney, he calmly told the jury that he killed 13 people and wounded 32 others in the 2009 attack.

“The evidence will clearly show that I am the shooter,” he said in an opening statement that lasted little more than a minute The evidence, he added, would “only show one side.”

His only utterance of regret was an acknowledgement that he was among “imperfect Muslims trying to establish the perfect religion.”

“I apologize for any mistakes I made in this endeavor,” said Hasan, an American-born 42-year-old who was paralyzed after being shot by officers responding to the attack. He spoke from a wheelchair, wearing green Army fatigues and a gray, bushy beard.

Hasan planned the assault for months, prosecutor Col. Steve Henricks said, describing how the defendant stockpiled bullets, practiced at a shooting range and bought an extender kit so his pistol could hold more bullets.

If convicted, Hasan could get the death penalty. No American soldier has been executed since 1961, and military prosecutors showed that they would take no chance of fumbling details that could jeopardize any conviction.

They described a calculating Hasan, armed with two handguns and carrying paper towels in his pants pockets to conceal the sounds of rattling ammunition as he walked through a deployment-readiness center on the sprawling base.

“He came to believe he had a jihad duty to murder his fellow soldiers,” Henricks said, adding that Hasan had researched Taliban leaders’ call to wage holy war.

The government has also said Hasan sent more than a dozen emails starting in December 2008 to Anwar al-Awlaki, a radical U.S.-born Islamic cleric killed by a drone strike in Yemen in 2011.

The shooting happened about three weeks after Hasan learned he would be deploying to Afghanistan. Upon getting the orders that he was going overseas, Hasan told a base doctor that, “They’ve got another thing coming if they think they are going to deploy me,” Henricks said.

On the day of the attack, Hasan sat among his fellow soldiers who were preparing to go overseas. He tried to clear the area of civilians, even walking over to a civilian data clerk to tell her she was needed elsewhere in the building because a supervisor was looking for her. The prosecutor said the clerk thought that was odd but went anyway.

“He then yelled ‘Allahu akbar!’ and opened fire on unarmed, unsuspecting and defenseless soldiers,” Henricks told the jury of 13 officers.

During Tuesday’s proceedings, Hasan mostly looked down or straight ahead, occasionally leafing through paperwork while seated at the defense table. He spoke politely from his wheelchair, talking so softly at times that families of victims leaned forward to hear him.

Hasan declined to cross-examine any of the witnesses he shot or those who recounted his firearm purchases at a store called Guns Galore in nearby Killeen.

But he didn’t pass on a chance to cross-examine his former supervisor, who had given Hasan high marks on an evaluation the very week of what Hasan would only call “the incident.”

Mumbling and stumbling over his questions — at one point mispronouncing his own name — Hasan asked retired Lt. Col. Ben Phillips a series of questions about “medical personnel initiating mercy killings.” He also appeared to ask about a water supply in Iraq being contaminated with gas.

One soldier who was repeatedly shot testified that he played dead before realizing the gunman might notice he was sweating.

Staff Sgt. Alonzo Lunsford was hit seven times — twice inside the building when he played dead, then five more times outside. He said he decided to flee because “dead men don’t sweat.”

Soldiers were trying to push their way out of a double-door exit, he said. But one door was locked, so it created a bottleneck.

Hasan wanted to plead guilty to murder and attempted murder, but military rules forbid guilty pleas in death-penalty cases.

In writings and in previous court statements, he sought to argue that he carried out the shooting to defend the Taliban from American attacks. But the judge denied that request.

The trial is playing out amid high security at Fort Hood, where armed guards stood in doorways and 15-foot stacks of shock-absorbing barriers obscured the view of the courthouse. Jurors were told the trial could take months. Hasan needs regular breaks because of his paralysis.

Numerous requests have delayed the trial for years, including arguments over Hasan’s beard, which he insisted on growing despite the fact that it violates military regulations.

Hasan dismissed his attorneys earlier this year. Over the next several weeks, he could question many more witnesses who were among the wounded, plus dozens of others who were inside the post’s Soldier Readiness Processing Center at the time of the attack.