Alexandria, Virginia (CNN) -- A Virginia man accused of attempting to travel to Somalia to join the Islamist militant group Al-Shabaab appeared in federal court Thursday, requesting that an attorney be appointed for him.
Zachary Adam Chesser, 20, did not speak except to answer the magistrate judge's question regarding the attorney. He was dressed in a short-sleeved blue shirt and off-white cargo pants.
Chesser will remain in custody, Magistrate Judge Theresa Buchanan ruled. A detention hearing is set for Friday.
Prosecutors say Chesser, of Fairfax County, Virginia, had exchanged e-mails with Yemeni-American cleric Anwar al-Awlaki, whose name has been linked to an attack and an attempted attack on the United States. Chesser allegedly tried to fly on July 10 to Uganda and then on to Somalia.
According to an affidavit, he tried to take his infant son with him, telling his wife it was part of his "cover" to make it less likely anyone would suspect he was trying to go to Somalia to join Al-Shabaab. He was arrested Wednesday.
Chesser had been on the FBI's radar previously. He was questioned in 2009 about his Internet postings and e-mail communications with al-Awlaki. U.S. officials revealed at some point they began court-ordered electronic surveillance of Chesser.
In April, Chesser, who also goes by the name Abu Talhah al Amrikee, authored a post on the radical Islamic website Revolutionmuslim.com that included a warning to the creators of the TV cartoon series "South Park" after an episode included an image of the Prophet Mohammed in a bear suit.
The posting on Revolutionmuslim.com says: "We have to warn Matt (Stone) and Trey (Parker) that what they are doing is stupid and they will probably wind up like Theo van Gogh for airing this show. This is not a threat, but a warning of the reality of what will likely happen to them."
Van Gogh was a Dutch filmmaker who was murdered by an Islamic extremist in 2004 after making a short documentary on violence against women in some Islamic societies. The posting on Revolutionmuslim.com features a graphic photograph of van Gogh with his throat cut and a dagger in his chest.
The entry on Revolutionmuslim.com goes on to advise readers: "You can contact them [the makers of 'South Park'], or pay Comedy Central or their own company a visit at these addresses ..." and lists Comedy Central's New York address, and the Los Angeles, California, address of Parker and Sloane's production company.
Chesser told CNN at the time that providing the addresses was not intended as a threat, but to give people the opportunity to protest.
Chesser is charged with providing material support for terrorism. If convicted, he could face a prison sentence of up to 15 years.
Several people who attended Thursday's hearing, including a woman wearing a burqa who appeared to be weeping, refused to speak to reporters.
The court documents said Chesser was not allowed to depart the country on July 10, was told by the airline he was on the "no-fly list," and was questioned by a Secret Service agent. He was not arrested and, according to the documents, he contacted an FBI agent and said he wanted to provide information about Al-Shabaab.
In subsequent interviews with the FBI, Chesser allegedly said he had been in contact with Al-Shabaab, felt he would have no problem joining the group when he reached Somalia and knew it had been designated as a terrorist group by the U.S. government.
Court documents say Chesser thought that after training he would be placed in the group's media branch but that people in that position still engage in fighting. He allegedly said he also unsuccessfully attempted to travel to Somalia in 2009.
In 2009, he allegedly told the FBI that he had sent several e-mail messages to al-Awlaki and that the cleric replied to two of them. U.S. officials say al-Awlaki also had communications with Umar Farouk AbdulMutallab, who is accused of attempting to blow up an airliner over Detroit, Michigan, on Christmas, and with Army Maj. Nidal Hasan, who is accused of the shooting deaths of 13 people at Fort Hood, Texas, in November.
An FBI agent who interviewed Chesser last year said Chesser said that "although he didn't support acts of terrorism or violence, he wanted the U.S. to fail in its overseas military efforts, and he acknowledged that its failure would require many deaths," according to the affidavit. Chesser allegedly told the agent he had wanted to travel overseas to fight but changed his mind and had moderated his views.
He also allegedly told the FBI in 2009 he was not on good terms with mother "as a result of death threats that she received following postings he made on the Internet regarding the South Park television show," the affidavit said.
In the April post, Revolutionmuslim.com posted audio of al-Awlaki over photographs of Parker, Stone, van Gogh and others.
The sermon, recorded some time ago, talks about assassinating those who have "defamed" the Prophet Mohammed -- citing one religious authority as saying "Harming Allah and his messenger is a reason to encourage Muslims to kill whoever does that." U.S. officials say al-Awlaki is on a list of al Qaeda leaders targeted for capture or assassination.
The clip ends with a warning on a graphic directed at Parker and Stone, saying "The Dust Will Never Settle Down."
Chesser said at the time the purpose of including the al-Awlaki sermon in his posting was to remind Muslims that insulting the prophet is a severe offense for which the punishment in Islam is death.
Revolutionmuslim.com, based in New York, was the subject of a CNN investigation last year for its radical rhetoric supporting "jihad" against the West and praising al Qaeda leader Osama bin Laden. Its organizers insist they act within the law and seek to protect Islam.
CNN's Tim Lister contributed to this report.