NEWARK, N.J. - To one North Jersey counterterrorism task force, Mohammad Qatanani was considered an essential ally - a moderate Muslim leader known for inviting FBI agents into his congregation to conduct seminars on terrorism prevention.

Fifteen miles away, in Newark, a different counterterrorism task force labeled Qatanani a possible terror suspect who had been categorized as a "person of interest" on his application for a green card.

His deportation trial - testimony concluded Monday and a ruling is due in September - has raised questions as to how smoothly counterterrorism efforts are coordinated in New Jersey, and about the ability of immigration authorities to get information from other agencies or check a person's background in their country of origin.

Qatanani, a 44-year-old Palestinian, has been the spiritual leader at the Islamic Center of Passaic County since 1996. The mosque is in Paterson, the heart of New Jersey's Arab American community and home to one of the largest Muslim populations in the region.

Qatanani's 1999 bid for U.S. residency was rejected, and he is facing deportation by U.S. immigration authorities who say he failed to disclose on his green card application a 1993 arrest and conviction in Israel for being a member of the militant group Hamas.

Qatanani has denied being a Hamas member and said he was never made aware of any charges against him. At his deportation hearing, he testified that he had been detained - not arrested - by the Israelis and subjected to physical and mental abuse in detention.

Since the proceedings began in early May, a number of witnesses have testified on the imam's behalf - including a rabbi and several high-ranking New Jersey law enforcement officials. Hundreds of his supporters have maintained a vigil outside the federal courthouse in Newark for the duration of the trial, often using a megaphone to conduct prayers and plead for justice.

The disputed Israeli detention forms the basis of the U.S. government's case against Qatanani. U.S. immigration officials testified they didn't know about it until the imam brought it to their attention during a 2005 meeting he initiated to inquire about the six-year delay in processing his green card.

Heather Philpott, an Immigration and Customs Enforcement agent, testified that when she first saw Qatanani's file in 2002, it had been categorized as a possible terrorism-related case.

Philpott testified such flags are computer-generated by the Interagency Border Inspection System, a consortium of federal and local databases that checks anything from a suspended license to a criminal conviction.

Philpott also said Qatanani's file contained no information as to why it had been flagged, and as a member of a Newark-based counterterrorism task force, she followed protocol by forwarding it to the FBI. She said the FBI background check came back clean.

Qatanani's lawyer, Claudia Slovinsky, asked Philpott whether she had done a background check on Qatanani in Israel or Jordan - the countries in which he had spent most of his life.

"We can't go on a fishing expedition for everyone who enters the country," Philpott replied.

She testified that information from foreign governments was only included in the border inspection system's database if those governments voluntarily submit it.

Immigration Judge Alberto J. Riefkohl pressed Philpott on why immigration officials had not followed up more aggressively on the imam's case if they were concerned about him.

"Taking into account there was a counterterrorism hit on his file, are you telling me there's no mechanism to make an inquiry in those countries?" Riefkohl asked.

Philpott said that was the job of the FBI.

The Newark FBI office did not return calls for comment.

Meanwhile, 15 miles away in Paterson, Passaic County Sheriff Jerry Speziale testified that Qatanani had never been identified to his joint-terrorism task force as a person of concern - despite being a highly public Muslim leader in a city where several of the Sept. 11 hijackers had lived prior to the attacks.

"I know Dr. Qatanani as an individual that has bridged the gap between law enforcement and the community, that has fought against terrorism, that has brought peace," Speziale said. "There may be a missing piece of the puzzle - but not my puzzle."

During cross-examination, government lawyers asked Speziale if immigration or law enforcement officials had ever shared information about the Qatanani investigation with him.

"I don't think you guys would show it to me, would you?" Speziale said.

"Absolutely," the lawyer answered.

When asked to clarify the procedure for sharing information or conducting background checks on immigrant applicants in their countries of origin, a spokesman for U.S. Citizenship and Immigration Services referred questions to Immigration and Customs Enforcement.

Michael Gilhooly, a spokesman for ICE, said he was not authorized to comment on an ongoing case.