IMOGIRI, Indonesia — Scattered on a forested hillside in this remote, almost pristine area of Central Java is the Ilmu Giri Pesantren, an Islamic boarding school that six years ago began offering a new kind of curriculum to a handful of local farmers.

Today, students of Islam, young and old and from all over the country, are flocking to this tiny, mostly outdoor campus to hear its founder, Nasruddin Anshory, preach about a Muslim’s ordained responsibility to protect the environment.

“As a Muslim,” he says to the students, who sit cross-legged in the dirt beneath the jungle canopy, feverishly taking notes, “you must do something.”

Ilmu Giri rose to prominence during the 2007 United Nations Climate Change Conference in Bali, where Anshory was celebrated for his teachings. But environmentalism had been taught in Indonesian Islamic boarding schools, known as pesantren, since at least the 19th Century — long before anyone paid attention to melting ice caps or rising sea levels.

On the Island of Madura in East Java is Pesantren Guluk-Guluk, also called Al-Nuqayah, which was established in 1887. Its founder, Muhammad Syarqawi, originally opened the school to spread Islam on an island that was then a lawless and often violent place.

He soon found the real problem to be the small island’s devastated environment. It was desperately dry and fresh water was scarce, forcing the inhabitants to fight over resources. So Syarqawi shifted his focus to teaching the island’s villagers, with the help of the Quran, about conservation.

It was hardly a stretch, says Achmad Suaedy, director of the Wahid Institute, an organization founded by Indonesia’s former president Abdurrahman Wahid that promotes peaceful and pluralistic Islam, and which has been working to promote “Green Islam” within Indonesia’s pesantrens.

“There are numerous passages in the Quran that refer to environmental protection,” he said. “There’s the line, for instance, that equates a human life with that of a tree: ‘Do not kill women, elders, children, civilians or trees.’”

In fact, the very origins of Islam are thought to be partly rooted in the early Muslims’ need to preserve scarce resources.

“The advent of Islam as an organized religion occurred in the desert environment of Arabia, and hence there was considerable attention paid to ecological concerns within Islamic ethics,” said Saleem Ali, associate dean of graduate studies at the University of Vermont’s Rubenstein School for the Environment. “There is a reverence of nature that stems from essential pragmatism within the faith.”

Still Guluk-Guluk remained the only one of its kind for more than a century. It’s been only in the last five years, just as global awareness of climate change and other environmental issues have increased, that “Green Islam” here has really taken root.

Attendance at Guluk-Guluk has ballooned from 1,200 to more than 6,500 students. And a number of those new environmentalists have gone on to open their own schools in cities all over the country.

There are now ever-growing networks of pesantrens going green, making Indonesia the unlikely pioneer of environmental Islam. The Indonesian government, recognizing the potential benefits of having the country’s 17,000 pesantren adopt some form of environmentalist program, has begun to vigorously promote such curriculums.

State Environment Minister Gusti Muhammad Hatta announced earlier this month that about 90 pesantrens in Central Java would take part in his new “eco-pesantren” pilot program, with the hope of broadening it to still hundreds more in the coming year.

Hatta said there are about 4 million students attending pesantrens, the world’s largest network of Islamic boarding schools, who could take what they learn back to their home towns.

“Indonesia is really the world leader in this area,” said Ali, adding that Islam generally trails other major religions in faith-based environmental initiatives.

At Ilmu Giri, the results of their environmentalist education have already begun to show.

Not long ago this hillside had been stripped bare by logging, which in turn gave way to a series of landslides that obliterated nearby villages.

“I remember the stories my parents told me about those landslides,” said Wardoyo, a young Ilmu Giri student who grew up here. “Now, Pak Nasruddin teaches us that if we have to cut down a tree, we must plant two more.”

Within several years of the school’s founding, the small farming community managed to “re-green” the entire hillside. Anshory’s students now plant thousands of trees every year.