A former roommate of Zacarias Moussaoui who admitted he lied to investigators about their activities together was sentenced Tuesday to time served.

Hussein al-Attas, 24, had pleaded guilty in July to lying about Moussaoui to FBI agents before and after the Sept. 11 attacks. He agreed to testify against him.

Moussaoui, the so-called 20th hijacker who was arrested in Minnesota the month before the attacks when a flight school became suspicious, faces a death penalty trial as an alleged conspirator in the attacks.

Al-Attas testified in July that on several occasions Moussaoui "expressed a general desire to participate in Jihad," or holy war.

Al-Attas also said then that Moussaoui, who went by the name "Shaqil," sought to persuade him to go to Pakistan to speak with Islamic scholars and others who believe that Islam favors participation in Jihad.

In a letter to U.S. District Judge Michael Mukasey before Tuesday's sentencing, al-Attas apologized, saying he was "in a state of shock and confusion when I lied to law enforcement agents."

"All I was trying to do was to distance myself from a situation that didn't really involve me," he said. "Still, I should have been truthful and let the truth take care of me."

Mukasey sentenced al-Attas to time served, though he will remain in custody the rest of the year as a material witness for the Moussaoui trial.

Al-Attas, a Yemeni citizen, lived in Norman, Okla., with Moussaoui in the summer of 2001. they became roommates after Moussaoui enrolled at the nearby Airman Flight School. Later, Moussaoui asked al-Attas to drive him to Eagan, Minn., a Minneapolis suburb, where he enrolled in a flight school there.

Alexander E. Eisemann, a lawyer for al-Attas, said in a letter to the judge that his client "was nothing more than a good person who reacted inappropriately when he found himself in the wrong place at the wrong time."

Eisemann said it was a natural reaction for al-Attas to try to lower his profile after Sept. 11 to distance himself from Moussaoui although it was a mistake in judgment to make false statements.

Moussaoui was arrested Aug. 16 in Eagan, Minn., after administrators at the flight school there became suspicious of his intense desire to fly jumbo jets despite his poor flying skills. Al-Attas was taken into custody with Moussaoui for questioning for two days, released, and then detained again on Sept. 11.

Moussaoui, a French citizen of Moroccan descent, is the only person charged with conspiring to help 19 hijackers who plunged two passenger jets into the World Trade Center, a third into the Pentagon and a fourth into a Pennsylvania field.