In the twilight of the Cold War, the United States spent millions of dollars to supply Afghan schoolchildren with textbooks filled with violent images and militant Islamic teachings, part of covert attempts to spur resistance to the Soviet occupation.

The primers, which were filled with talk of jihad and featured drawings of guns, bullets, soldiers and mines, have served since then as the Afghan school system's core curriculum. Even the Taliban used the American-produced books, though the radical movement scratched out human faces in keeping with its strict fundamentalist code.

As Afghan schools reopen today, the United States is back in the business of providing schoolbooks. But now it is wrestling with the unintended consequences of its successful strategy of stirring Islamic fervor to fight communism. What seemed like a good idea in the context of the Cold War is being criticized by humanitarian workers as a crude tool that steeped a generation in violence.

Last month, a U.S. foreign aid official said, workers launched a "scrubbing" operation in neighboring Pakistan to purge from the books all references to rifles and killing. Many of the 4 million texts being trucked into Afghanistan, and millions more on the way, still feature Koranic verses and teach Muslim tenets.

The White House defends the religious content, saying that Islamic principles permeate Afghan culture and that the books "are fully in compliance with U.S. law and policy." Legal experts, however, question whether the books violate a constitutional ban on using tax dollars to promote religion.

Organizations accepting funding from the U.S. Agency for International Development must certify that tax dollars will not be used to advance religion. The certification states that AID "will finance only programs that have a secular purpose. . . . AID-financed activities cannot result in religious indoctrination of the ultimate beneficiaries."

The issue of textbook content reflects growing concern among U.S. policymakers about school teachings in some Muslim countries in which Islamic militancy and anti-Americanism are on the rise. A number of government agencies are discussing what can be done to counter these trends.

President Bush and first lady Laura Bush have repeatedly spotlighted the Afghan textbooks in recent weeks. Last Saturday, Bush announced during his weekly radio address that the 10 million U.S.-supplied books being trucked to Afghan schools would teach "respect for human dignity, instead of indoctrinating students with fanaticism and bigotry."

The first lady stood alongside Afghan interim leader Hamid Karzai on Jan. 29 to announce that AID would give the University of Nebraska at Omaha $6.5 million to provide textbooks and teacher training kits.

AID officials said in interviews that they left the Islamic materials intact because they feared Afghan educators would reject books lacking a strong dose of Muslim thought. The agency removed its logo and any mention of the U.S. government from the religious texts, AID spokeswoman Kathryn Stratos said.

"It's not AID's policy to support religious instruction," Stratos said. "But we went ahead with this project because the primary purpose . . . is to educate children, which is predominantly a secular activity."

Some legal experts disagreed. A 1991 federal appeals court ruling against AID's former director established that taxpayers' funds may not pay for religious instruction overseas, said Herman Schwartz, a constitutional law expert at American University, who litigated the case for the American Civil Liberties Union.

Ayesha Khan, legal director of the nonprofit Americans United for Separation of Church and State, said the White House has "not a legal leg to stand on" in distributing the books.

"Taxpayer dollars cannot be used to supply materials that are religious," she said.

Published in the dominant Afghan languages of Dari and Pashtu, the textbooks were developed in the early 1980s under an AID grant to the University of Nebraska-Omaha and its Center for Afghanistan Studies. The agency spent $51 million on the university's education programs in Afghanistan from 1984 to 1994.

During that time of Soviet occupation, regional military leaders in Afghanistan helped the U.S. smuggle books into the country. They demanded that the primers contain anti-Soviet passages. Children were taught to count with illustrations showing tanks, missiles and land mines, agency officials said. They acknowledged that at the time it also suited U.S. interests to stoke hatred of foreign invaders.

"I think we were perfectly happy to see these books trashing the Soviet Union," said Chris Brown, head of book revision for AID's Central Asia Task Force.

AID dropped funding of Afghan programs in 1994. But the textbooks continued to circulate in various versions, even after the Taliban seized power in 1996.

Officials said private humanitarian groups paid for continued reprintings during the Taliban years. Today, the books remain widely available in schools and shops, to the chagrin of international aid workers.

"The pictures [in] the texts are horrendous to school students, but the texts are even much worse," said Ahmad Fahim Hakim, an Afghan educator who is a program coordinator for Cooperation for Peace and Unity, a Pakistan-based nonprofit.

An aid worker in the region reviewed an unrevised 100-page book and counted 43 pages containing violent images or passages.

The military content was included to "stimulate resistance against invasion," explained Yaquib Roshan of Nebraska's Afghanistan center. "Even in January, the books were absolutely the same . . . pictures of bullets and Kalashnikovs and you name it."

During the Taliban era, censors purged human images from the books. One page from the texts of that period shows a resistance fighter with a bandolier and a Kalashnikov slung from his shoulder. The soldier's head is missing.

Above the soldier is a verse from the Koran. Below is a Pashtu tribute to the mujaheddin, who are described as obedient to Allah. Such men will sacrifice their wealth and life itself to impose Islamic law on the government, the text says.

"We were quite shocked," said Doug Pritchard, who reviewed the primers in December while visiting Pakistan on behalf of a Canada-based Christian nonprofit group. "The constant image of Afghans being natural warriors is wrong. Warriors are created. If you want a different kind of society, you have to create it."

After the United States launched a military campaign last year, the United Nations' education agency, UNICEF, began preparing to reopen Afghanistan's schools, using new books developed with 70 Afghan educators and 24 private aid groups. In early January, UNICEF began printing new texts for many subjects but arranged to supply copies of the old, unrevised U.S. books for other subjects, including Islamic instruction.

Within days, the Afghan interim government announced that it would use the old AID-produced texts for its core school curriculum. UNICEF's new texts could be used only as supplements.

Earlier this year, the United States tapped into its $296 million aid package for rebuilding Afghanistan to reprint the old books, but decided to purge the violent references.

About 18 of the 200 titles the United States is republishing are primarily Islamic instructional books, which agency officials refer to as "civics" courses. Some books teach how to live according to the Koran, Brown said, and "how to be a good Muslim."

UNICEF is left with 500,000 copies of the old "militarized" books, a $200,000 investment that it has decided to destroy, according to U.N. officials.

On Feb. 4, Brown arrived in Peshawar, the Pakistani border town in which the textbooks were to be printed, to oversee hasty revisions to the printing plates. Ten Afghan educators labored night and day, scrambling to replace rough drawings of weapons with sketches of pomegranates and oranges, Brown said.

"We turned it from a wartime curriculum to a peacetime curriculum," he said.

Illustrations of land mines and knives, found in a math primer bought last week in Pakistan, resemble drawings found in old schoolbooks furnished to Afghans by AID.First lady Laura Bush told Afghanistan's interim leader, Hamid Karzai, on Jan. 29 that AID would provide $6.5 million for new textbooks and for training teachers.