KILLEEN, Tex. — Months after deciding to act as his own lawyer, Maj. Nidal Malik Hasan declined to present a defense in his military trial on Wednesday, passing up an opportunity to counter hundreds of witnesses and pieces of evidence prosecutors have used to persuade a jury to find him guilty of murdering and wounding dozens of unarmed soldiers in 2009.

As relatives of some of Major Hasan’s victims looked on, the judge overseeing his court-martial asked him to proceed Wednesday morning, after Army prosecutors rested their case the day before.

“The defense rests,” Major Hasan told the judge inside the packed Fort Hood courtroom.

The judge dismissed the jury and later asked Major Hasan if he understood that he had a right to testify if chose to. He said he did. Had he taken the stand and testified, Army prosecutors would have been allowed to cross-examine him. During the sentencing phase, however, Major Hasan could give an unsworn statement and not be subject to cross-examination.

Major Hasan, 42, has been charged with 45 counts of murder and attempted murder in a shooting rampage inside a medical deployment center at the Fort Hood base here on Nov. 5, 2009. He admitted to the jury in his opening statement at the start of the trial on Aug. 6 that he was the gunman. According to prosecutors and previous statements Major Hasan has made both in and out of court, he was motivated by two desires — to avoid deployment to Afghanistan and to kill as many soldiers as he could as part of a jihad to protect Muslims from American military aggression.