A Muslim soldier was stopped hours before completing a bomb he planned to detonate at a Texas restaurant full of US troops, federal prosecutors have said.
Naser Jason Abdo intended to commit mass murder near Fort Hood, the prosecution team said in opening statements at his trial.
FBI special agent C Michael Owens testified that Abdo said he went to the city of Killeen to "martyr himself" for the people of Iraq and Afghanistan.
Defence lawyers countered that no bomb was built.
Abdo, 22, who was absent without leave from Fort Campbell, Kentucky, is accused of planning to bomb a Killeen restaurant filled with Fort Hood soldiers and shoot any survivors last summer.
His federal trial is taking place in Waco, about 50 miles north-east of Killeen, just outside Fort Hood.
Abdo faces up to life in prison if convicted of attempting to use a weapon of mass destruction, the most serious of the six charges on which he is being tried.
He is not being tried in military court, and his lawyers are not seeking an insanity defence.