A federal judge on Friday rejected a defense motion to throw out a confession from the soldier accused of planning to bomb a Texas restaurant filled with Fort Hood troops.

Lawyers for Army Pfc. Naser Jason Abdo say authorities did not read his Miranda rights or grant his request for a lawyer before he told them of plans to blow up the building and shoot survivors. They also asked the judge to suppress evidence obtained after Abdo was detained in July at a Killeen motel near the Texas Army post.

U.S. District Judge Walter Smith rejected the motions Friday after a four-hour hearing in Waco.

Abdo, 22, faces up to life in prison if convicted of attempting to use a weapon of mass destruction and eight other charges. His trial is set for May.

In a muffled recording played in court Friday, a police detective, Sgt. Eric Bradley, is heard saying he saw footage of Abdo in area stores and asking if the soldier knew about events in Killeen, including the 2009 shooting rampage at Fort Hood in which an Army psychiatrist is charged.

Abdo tells the detective in the recording that he applied for conscientious objector status but it was put on hold after he was charged with having child pornography.

"So I'm AWOL ... and I was planning an attack here in the Fort Hood community," Abdo says in the recording.

Another Killeen detective testified that he read Abdo his Miranda rights shortly after placing him in a police car, but said the audio did not record because of a delay and no other officers were present. Bradley talked to Abdo in the police car after that.

C. Michael Owens, an FBI special agent, testified that he read Miranda rights to Abdo twice -- before interviews with him on July 27 and 28. Prosecutors showed documents signed by Abdo agreeing to talk to investigators and waiving his rights to an attorney. During the first six-hour interview, Abdo said he was in Killeen to make things right with Allah because he had sinned against Allah, Owens testified.

Abdo was AWOL from Fort Campbell, Kentucky, when he was arrested. Authorities say they found a handgun, ingredients for an explosive device and an article titled "Make a bomb in the kitchen of your Mom" in his room and backpack. An article with that title appears in an al-Qaida magazine.

Bradley testified Friday that officers began investigating Abdo after a Guns Galore store employee called July 26, saying a young man bought six pounds of smokeless gunpowder, shotgun ammunition and a magazine for a semiautomatic pistol -- while seeming to know little about his purchases. The man also bought a U.S. Army uniform from another local store and a "Smith" name patch but didn't know his unit, according to testimony Friday.

Officers tracked Abdo to a motel, where they stopped and handcuffed him as he walked out with a full backpack on the afternoon of July 27, Bradley said.

That night, two FBI agents working in a command center took messages from the same supervisory agent-in-charge saying that Abdo had requested an attorney, according to documents produced by defense attorneys Friday. Both agents testified that they didn't recall if they had spoken to the supervisory agent directly and said they did not try to verify the information.

The supervisory agent testified Friday that he was not in Killeen that night, never received information about Abdo wanting an attorney and did not pass along that message to anyone.

Zachary Boyd, one of Abdo's attorneys, showed motel footage of Abdo being taken into custody. Although officers said Abdo was just being detained, Boyd pointed out that guns were pointed at him while he was lying face down before he was handcuffed and placed in a police car, the definition of an arrest -- "and when you're under arrest, Miranda attaches."

Boyd also said Abdo was not acting suspiciously at the motel before he was approached by officers and that his purchases were not illegal.

But federal prosecutor Mark Frazier said "good police work" is what led detectives to Abdo -- not hunches -- and their actions at the motel were reasonable and appropriate, based on Abdo's purchases at the gun store and Army surplus store.

Guns Galore is the same store where Army Maj. Nidal Hasan, the psychiatrist charged in the 2009 Fort Hood rampage, bought a new laser-equipped semiautomatic handgun. Hasan faces the death penalty if convicted of 13 counts of premeditated murder and 32 counts of attempted premeditated murder. His military trial is to start in August at Fort Hood.