In the years after the American-led invasion, cheaply printed and brazenly pirated books from Pakistan were as dominant as that country’s fruits and vegetables in the markets of Kabul.

Afghanistan’s new government faced the enormous task of rebuilding the educational system, which had been savaged by decades of civil war, followed by five years of a Taliban regime that closed schools and destroyed foreign-language books. That meant millions of new textbooks, which initially were printed in Pakistan. But as relations with that country soured, the government steered those textbook contracts to a few major Afghan publishers.

Foreign aid underwrote the school system, so the textbook business jump-started the book publishing industry. Because millions of textbooks had to be printed in a short period of time, Aazem and a few other companies invested in their own presses, which went largely idle once the school publishing season was over. Then the new publishers began translating Western books from English into Dari and Pashto, the country’s two main languages.

Other publishers sprung up, renting the bigger companies’ presses.

“There was such a curiosity and thirst to know about the world and how people think about Afghanistan,” said Davood Moradian, director general of the Afghan Institute for Strategic Studies, a research organization whose picturesque ancient campus, the Fort of Nine Towers, is a favored venue for book parties. “The book industry is a growing phenomenon to try to satisfy that thirst.”

The first locally published books were nonfiction titles about Afghanistan, by Western authors, and they sold so well, there was a rush into the business. Books like “Ghost Wars: The Secret History of the C.I.A., Afghanistan and Bin Laden From the Soviet Invasion to September 10, 2001,” by Steve Coll, and “The Envoy: From Kabul to the White House, My Journey Through a Turbulent World,” by Zalmay Khalilzad, hit the best-seller lists here.

“There was this huge pent-up demand from so many years without new books,” said Dr. Ajmal Aazem, a pediatrician whose father founded the publishing house that bears their name. The Aazem company is publishing books as fast as it can, limited only by a shortage of qualified translators from English into local languages. Aazem’s 2017-18 goal is to print three new titles a day, 1,100 a year — a huge number for any publisher.