KARACHI, Pakistan — Anas bin Saleem, a 12-year-old American, spends seven hours a day sitting cross-legged on the floor memorizing the Quran.
He is one of thousands of foreigners who have flocked to conservative Islamic schools in Pakistan, despite a government ban, the Associated Press has found through interviews with officials, documents, visits to the schools and encounters with dozens of students.
Pakistan and foreign governments consider the international students a potential security threat. The students could export extremism back to their own countries, or stay and fight in Pakistan and neighboring Afghanistan, where the United States is battling a resurgent Taliban eight years after the invasion. Pakistan stopped granting student visas in 2005, but many students still arrive on travel visas and never leave when they expire.
"We are concerned, but what can we do?" said an official from one Southeast Asian embassy in Pakistan who asked for anonymity because he did not want to upset his hosts. "We can't stop people from traveling...It is their constitutional right."
Officials are concerned in general about foreigners coming to Pakistan for training in militancy. Most recently, five young American Muslims were arrested after meeting with representatives of an al-Qaida linked group and asking for training, a Pakistani law enforcement official said Thursday.
And in a separate case, the U.S. accuses another American, David Coleman Headley, of attending militant training camps in Pakistan and conspiring with members of the Pakistan-based militant group Lashkar-e-Taiba to conduct surveillance on potential targets in the Indian city of Mumbai before the deadly terror attacks there in November 2008.
In Anas' school, Jamia Binoria, several hundred students from 29 countries live alongside 5,000 Pakistani pupils, teachers said. Binoria is one of the largest schools in the country and one of at least four schools in Karachi with foreign students on its books.
Anas says he's not taught militant Islam at Binoria. But clerics firmly endorse suicide bombings and jihad against Western troops in Afghanistan on the school Web site, and Anas admits he is fed up with anti-American barbs from teachers and pupils.
"I get it like every second," says Anas, who left Louisiana last year with his Pakistani-born mother, barely spoke the national language when he arrived in Pakistan and misses Hannah Montana. "I'm like 'shut up' and don't talk like that."
Only a handful of the foreign students are Westerners; most are Asians and Africans in the late teens or early 20s. Many come to Pakistan for a cheap Islamic education, albeit a conservative one, part of a tradition of Muslims traveling to gain knowledge that goes back centuries.
But with Pakistan now a main global hub for al-Qaida and other militant groups, their presence in poorly regulated schools – many with links to extremist groups – inevitably raises concerns.
Some get their visas extended by sympathetic officials, according to school and government officials. School principals help by concealing the students' identities from authorities, officials told The Associated Press.
"Where there is a will, there is a way," said Mohammad Naeem, the head of Anas' school, without elaborating. "They are committed to getting an Islamic education."
Many students are from countries themselves battling terrorist groups or Islamic insurgencies, such as Somalia, Thailand, Indonesia and the Philippines. Governments there are desperate to avoid their citizens linking up with al-Qaida operatives abroad or returning home radicalized.
The minutes of a meeting attended by government and security agencies in Karachi obtained by The Associated Press concluded that foreign students at Islamic schools are still being admitted with no clearance from security agencies, something those present said was "illegal" and posed a "serious security risk." It recommended they be deported.
Interior Minister Rehman Malik denied anyone was slipping into the country unawares, and said students suspected of links to militancy were deported. But a senior interior ministry official in the city said the ban was not being fully enforced because of fears of a backlash by the madrassas, which can quickly incite thousands of young men.
"We have a tendency to soft pedal in Pakistan, especially when it comes to Islamic affairs," said the official, who asked for anonymity to discuss the sensitive subject.
Pakistan's government has struggled for years to supervise the country's approximately 15,000 madrassas, many of which critics say are breeding grounds for militants. Several are linked to sectarian or extremist groups implicated in violence.
In 2003, for example, a group of 12 Southeast Asians were arrested from schools in Karachi, one of whom was later convicted of transferring money to fund attacks in Indonesia. Another member of the group was arrested in July and is awaiting trial in Jakarta in connection with twin suicide bombings in Western hotels.
Some madrassas have refused to comply with the ban because they see it as another example of the government interfering in their affairs and stigmatizing them. They complain that no such restrictions exist on foreigners wanting to study at Pakistani medical colleges, for example.
"Under the United Nation's charter, every religion is free to teach," said Qari Iqbal, an administrator at Jamia Islamiyah, which is known for having educated several leaders of the former Taliban regime in Afghanistan as well as at least three militant commanders in Pakistan. "Why are Muslims being singled out?"
Iqbal said the school was home to just 19 foreigners, all of whom were finishing courses that began before 2005.
Thais are believed to make up the largest single group of foreigners in the country. Almost all come from the south of the country, where Muslim insurgents are fighting a bloody war against the government of the Buddhist-majority country.
Thai government spokesman Panitan Wattanayagorn said there was no evidence the students were returning from Pakistan to join the war, but acknowledged the government did not know how many Thais were in the Pakistan, and their identities.
At one rundown school in Karachi, students from Indonesia, Southern Thailand and Cambodia gathered together recently to cook and eat dinner together in a makeshift kitchen on the roof. The smell of dried, fermented fish popular in parts of Southeast Asia hung in the air.
At another, several Africans were among those lining up for communal prayers.
"There are so many African brothers here in Karachi I can't begin to count them," said Musa, from Sierra Leone, before other students urged him to stop talking. The AP team was angrily accosted as it left the mosque by a smartly dressed man who refused to identify himself.
Most of the students are affiliated with Tablighi Jemaat, which translates as "preaching community," an international Islamic missionary movement that has strong roots in Pakistan.
While conservative, it is not a militant group. Still, it has appeared on the fringes of many international terrorism investigations, with suspects – including "American Taliban" John Walker Lindh – either using it as mask to travel to Pakistan or as a springboard into violence.
Each year, about 5,000 travel to the country to attend short courses or preach in mosques, said a member of the group.
A yearly gathering close to the group's headquarters in the Punjabi town of Raiwind attracts hundreds of thousands of followers, many from abroad.
Christine Fair, an American academic who has studied Pakistani madrassas and militant recruitment, said foreigners associated with Tablighi represented more of a worry than those enrolled at schools.
"If you want to become a militant, Raiwind represents an opportunity to meet potential recruiters, and get yourself to a camp," she said. "Anyone can get a visa to go."