(CNN) -- A former U.S. soldier charged with attempting to join a terrorist group was sentenced to seven years in prison Monday after pleading guilty to destroying records that could be used in a terror investigation, federal prosecutors said.
U.S. District Judge J. Frederick Motz also sentenced the ex-soldier to five years of supervised release after his prison time.
Craig Benedict Baxam, 26, of Laurel, Maryland, was arrested in Kenya in December 2011 en route to southern Somalia where he planned to join al Shabaab, according to a summary of the plea agreement in a news release from U.S. Attorney for the District of Maryland Rod Rosenstein.
"Baxam told the agents that because of his prior service in the U.S. Army, and specifically his training and experience in military intelligence, he knew of the U.S. government's capabilities in tracing internet protocol addresses and other investigative techniques," the plea agreement states. "Consequently, before leaving the U.S., he destroyed his personal home computer and threw the remains in a dumpster."
The news release continues: "He told the agents that he did not want any record left behind, and that he wanted to maintain a low profile. He also said that he purchased a round trip plane ticket to Kenya rather than a one-way ticket even though he had no intention of returning to the U.S., in order not to arouse the suspicion of the FBI and U.S. military."
According to a criminal complaint, Baxam departed the United States on December 20, 2011, for Kenya, where he was arrested three days later by Kenyan authorities on suspicion of terrorism.
Baxam was interviewed twice by FBI agents while in Kenyan custody and allegedly told them he wanted to join al Shabaab, live under Sharia law and never intended to leave Somalia. Baxam told the FBI he didn't have the names of any contacts in Somalia but that he "trusted in Allah," the complaint said.
Baxam said he was "looking for dying with a gun in my hand" and said he would be guaranteed a place in paradise, according to the criminal complaint.
Prosecutors said at the time of his arrest that Baxam had secretly converted to Islam days before leaving the Army in July.
He joined the Army in 2007 and underwent eight months of advanced training for cryptology and intelligence, according to the government.
After his training, Baxam was deployed to Baghdad and to South Korea, where he separated from the service one month before the completion of his deployment. The court document did not explain how Baxam left the Army early.
A law enforcement official said at the time of his arrest that there was no information to suggest Baxam had compromised any military information.
Prosecutors say Baxam cashed out his retirement savings account of more than $3,600. He allegedly planned to give al-Shabaab between $600 and $700 as an offering upon his arrival, authorities said.
"FBI Special Agents in Africa, working alongside our Kenyan police partners, worked together to stop an individual who is now alleged to have been on his way to join a major terrorist group," said Richard McFeely, the FBI agent in charge of the Baltimore office. "This spirit of cooperation in fighting terrorism continues to transcend borders around the world.
CNN's Paul Courson and Carol Cratty contributed to this report.