FORT HOOD, Texas — A military judge blocked several key pieces of evidence Monday that prosecutors said would explain the mindset of the soldier accused in the 2009 shooting rampage at Fort Hood, including his belief that he had a “jihad duty” to carry out the attack.

Prosecutors had asked the judge to approve several witnesses and various evidence to support what they allege motivated Maj. Nidal Hasan to kill 13 people and wound more than 30 others at the Texas military base. But the judge, Col. Tara Osborn, blocked nearly all of it.

Osborn barred any reference Hasan Akbar, a Muslim soldier sentenced to death for attacking fellow soldiers in Kuwait during the 2003 Iraq invasion. Prosecutors wanted to prove that Hasan, an American-born Muslim, wanted to carry out a “copycat” attack, but the judge said introducing such material would “only open the door to a mini-trial” of Akbar.

The judge said prosecutors also couldn’t introduce three emails, ruling that the needed redactions would make them irrelevant. The contents of the emails were never disclosed, but the FBI has said Hasan sent numerous 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 judge also told prosecutors that they couldn’t cite Hasan’s interest years ago in conscientious objector status and his past academic presentations. Osborn said such evidence was too old and irrelevant.

However, the judge will allow evidence about Internet searches on Hasan’s computer around the time of the attack and websites that Hasan had listed as “favorites.” Osborn said that information was more timely.

Military prosecutors opened the trial by saying they would show that Hasan felt he had a “jihad duty,” referring to a Muslim term for a religious war or struggle.