A 62-year-old Afghan doctor detained in Philadelphia this week on immigration fraud charges received and passed along coded messages from an anti-Western terror group with ties to al-Qaeda, federal prosecutors said.

At a court hearing Friday, Assistant U.S. Attorney Jennifer Arbittier Williams said FBI agents discovered the documents written in Pashto and hidden between glued pages of religious tracts mailed to Hayatullah Dawari's Northeast Philadelphia home.

The package, intercepted during a January raid, came from Pakistan and included instructions to forward several books inside to various people across the United States.

A later search uncovered a coded message similar to that found in Dawari's possession at the home of another associate in Philadelphia.

"The note, when translated from Pashto to English, appears to contain a message directing some urgent action," Williams said.

She would not describe the content of the messages, citing national security concerns, but quoted excerpts in court filings Friday.

"Please, utilize the sentence number [#] for the time being," one read, according to a government motion, which did not include the number mentioned in the cipher. Another instructed, "please, wait to receive other books for sentences number [#]"

Those snippets came as part of a government motion seeking Dawari's detention pending trial on charges that he lied about his association with Hezb-e-Islami Gulbuddin on an application for U.S. citizenship in November.

Prosecutors say that when asked on the form whether he had ever been a member of an organization, political party, club, or foundation, he answered no, despite a long-standing relationship to the group, which Williams described Friday as "a virulently anti-Western insurgent group active in Afghanistan and Pakistan."

The governments of the United States, the European Union, and Canada have classified Hezb-e-Islami Gulbuddin as a terrorist group. Its founder, Gulbuddin Hekmatyar, has repeatedly called for jihad on U.S. troops in Afghanistan and been designated a "global terrorist" by the Treasury Department.

Though Dawari has not been charged with terrorist activity, he has continued to communicate with members of the group, Williams said, most recently in a conversation this year in which he spoke to a Pakistani contact about the shipment of books.

"That is incorrect," Dawari said at a court hearing Friday, in which he was ordered detained until trial. "I am absolutely not guilty."

Nino Tinari, Dawari's lawyer, balked at the suggestion his client was involved in any anti-Western plotting.

He accused the government of inflating a simple immigration matter into a terrorism case.

"This is a fraud case," he said. "They're trying to elevate it into something involving al Qaeda."

The Justice Department frequently uses immigration fraud charges to target foreign nationals it suspects of other crimes.

Before German authorities sought the extradition of Philadelphia tool-and-die maker Johann Breyer this year on allegations that he participated in Nazi war crimes, federal prosecutors had sought to strip him of his U.S. citizenship in the 1990s, arguing that he lied on a citizenship application about his association with the German party. Breyer died before his case could be resolved.

Dawari, his lawyer said Friday, worked as a doctor in his home country - cooperating with American Red Cross efforts as part of American military operations in Afghanistan - before moving to Philadelphia in 2008. Since his arrival here, Dawari has become an active member of his mosque and a legal permanent resident, and was seeking citizenship to cement his life in America, Tinari said.

Though he recently became disabled, he worked for years as a convenience store clerk.

Before Dawari's arrest in the federal case Wednesday, U.S. immigration authorities had initiated deportation proceedings against him over allegations that he lied about a previous arrest record in Russia while obtaining his green card.

"This is a person who helped American individuals in Afghanistan and Pakistan, who is now being put to the test over some sentences in a letter," Tinari said.

If convicted in the immigration fraud case, Dawari could face up to 20 years in prison. Prosecutors said Friday that they intend to introduce evidence obtained through the U.S. government's warrantless surveillance program at Dawari's trial.