Saudi King Salman shakes hands with Indonesian President Joko Widodo.

When Saudi Arabia’s King Salman landed in Indonesia on Wednesday, he became the first Saudi monarch to visit the world’s largest Muslim-majority country since 1970. Officials in Jakarta had hoped the visit would help them strengthen business ties and secure $25 billion in resource investments. That’s largely been a bust—as of Thursday, the kingdom has agreed to just one new deal, for a relatively paltry $1 billion.

But Saudi Arabia has, for decades, been making investments of a different sort—those aimed at influencing Indonesian culture and religion. The king’s current visit is the apex of that methodical campaign, andhas the potential to accelerate the expansion of Saudi Arabia’s cultural resources in Indonesia,” according to Chris Chaplin, a researcher at the Royal Netherlands Institute of Southeast Asia. “In fact, given the size of his entourage, I wouldn’t be surprised if there will be a flurry of networking activity amongst Indonesian alumni of Saudi universities.”

How Indonesia Beat Back Terrorism—for Now

Since 1980, Saudi Arabia has devoted millions of dollars to exporting its strict brand of Islam, Salafism, to historically tolerant and diverse Indonesia. It has built more than 150 mosques (albeit in a country that has about 800,000), a huge free university in Jakarta, and several Arabic language institutes; supplied more than 100 boarding schools with books and teachers (albeit in a country estimated to have between 13,000 and 30,000 boarding schools); brought in preachers and teachers; and disbursed thousands of scholarships for graduate study in Saudi Arabia. All this adds up to a deep network of Saudi influence.

“The advent of Salafism in Indonesia is part of Saudi Arabia’s global project to spread its brand of Islam throughout the Muslim world,” said Din Wahid, an expert on Indonesian Salafism at Syarif Hidayatullah State Islamic University (UIN) in Jakarta.

Salaf is Arabic for “forebear,” and Salafism is a Sunni movement that advocates a return to the Islamic traditions of the Prophet Muhammad and his contemporaries. It arose in reaction to 18th-century European colonialism in the Middle East, but it took particular root in Saudi Arabia in the hands of the influential preacher Muhammad ibn Abd al-Wahhab. Al-Wahhab’s alliance with the House of Saud in 1744 cemented Wahhabism as the spiritual backbone of the Saudi Arabian state. And in the 20th century, Saudi Arabia, which had become fabulously oil-rich, started to invest its considerable resources in propagating its ideology abroad.

The heart of Indonesian Salafism is the Institute for the Study of Islam and Arabic (LIPIA), a completely Saudi-funded university in South Jakarta whose campus was abuzz the day before the king’s visit.

“It’s really great that our two countries are becoming closer,” said one student who, like most of the other male students at LIPIA, had a wispy beard and wore cropped pants, per hadith verses stating that covering one’s ankles connotes arrogance. “I’ve been reading all the news about the royal visit. I hope to further my own studies in Saudi Arabia, God willing.”

LIPIA’s doors opened in 1980. Its ostensible purpose is to spread the Arabic language, and there’s not a word of the country’s official language, Bahasa Indonesia, on its campus—not a bathroom sign, not a library book. Tuition at LIPIA is free for all its 3,500 students. Music is considered bid’ah, an unnecessary innovation, and is prohibited, along with television and loud laughter. Men and women do not interact; classes of male students attend live lectures on one floor while female students watch the same lecture, live-streamed, on a separate floor.

Indonesia’s Ministry of Religious Affairs accredited LIPIA in 2015, which bodes well for the university’s push to open four more branches across the archipelago. Hammed al-Sultan, head of LIPIA’s Arabic language department, was confident that the satellite campuses would open by the fall of this year. But they will need their own green lights from the ministry, which has voiced concerns about whether they will uphold moderate Islam and Indonesia’s state philosophy of Pancasila, which enshrines religious tolerance.

When I asked whether LIPIA Jakarta already does this, al-Sultan said, “Pancasila … sorry, what is that again?” A LIPIA representative acting as our translator quickly briefed him on it. Al-Sultan said, “Yes, our integration of Pancasila is in progress, since it was a requirement for our accreditation two years ago.”

Muhammad Adlin Sila of the Ministry of Religious Affairs was more frank. “We are concerned about some alumni from LIPIA who are big fans of khilafah [the caliphate of the Islamic State].”

Ulil-Abshar Abdalla, a LIPIA alumnus who now runs the Liberal Islam Network, said he found the university’s theological climate oppressive when he attended in the early 1990s. “Theology, which is a mandatory subject there, is only taught by committed Wahhabis, and I really think their ideology is antithetical to traditional Indonesian Islam, which is usually syncretic and relaxed,” he explained.

Beyond LIPIA, hundreds of Indonesians receive scholarships to study at Saudi universities every year. A few decades in, alumni of these programs are becoming nationally influential in their home country. Habib Rizieq, the founder of the Islamic Defenders Front, a hardline organization associated with religion-related violence, attended both LIPIA and King Saud University in Riyadh. Jafar Umar Thalib, who founded the militant Salafi group Laskar Jihad, also graduated from LIPIA. Right-wing Islamist leaders like Hidayat Nur Wahid, a member of parliament who earned three degrees on scholarship from the University of Medina, are prominent in mainstream politics.

LIPIA alumni have also set up pesantren, or Islamic boarding schools, across Indonesia. Many of the country’s 100-odd Salafi pesantren are supplied by Saudi Arabia with teachers, especially of Arabic language, and textbooks, according to Din Wahid. For many poor families, these pesantren are the only feasible option for their kids’ schooling, despite ideological quibbles, Wahid said.

Enterprising Saudi envoys have even made inroads in places like Aceh, the westernmost Indonesian province that’s been wracked by natural disasters like the 2005 tsunami. “We have built mosques, hospitals, and schools there,” the Saudi ambassador to Indonesia, Mohammad Abdullah Alshuaibi, told me. “And an Arabic language institute.”

One reason Indonesia has been reluctant to push back on Saudi cultural advances is the all-important hajj quota, the number of citizens who can make pilgrimage to Mecca in a given year. Indonesia gets the largest allowance in the world: 221,000 this year. But decade-long hajj waiting lists are common in many provinces, and jeopardizing the national allowance could provoke a huge backlash, said Dadi Darmadi, a UIN researcher and hajj expert.

“That being said, the Indonesian government has to be more wise and stop considering the hajj quota as a political gambit to attract more populist support in this country,” Darmadi said.

Nearly every Indonesian leader, from the president to the foreign minister to the Speaker of the House, has cited the hajj quota as an important focus of King Salman’s trip.

The first big policy objective announced for the visit, however, addressed not the hajj, but terrorism. A “pact to combat terrorism” will be the “centerpiece” of agreements signed in Indonesia this week, the Saudi ambassador, Alshuaibi, told reporters on Tuesday.

It’s ironic, then, that some of Indonesia’s leading jihadists have passed through Saudi institutions. Although Salafism is largely “quietist,” or discouraging of political activity, there is a growing faction of Salafi jihadists in Indonesia, according to Din Wahid. In 1972, Saudi money helped to found the “ivy league” of jihadist pesantren, the Al-Mukmin school in Ngruki, Central Java. The Indonesian terrorist group Jemaah Islamiyah received funding from Saudi charities in the early 2000s. Salafi TV, YouTube channels, Facebook groups, and Telegram channels have become a fertile ground for female extremists and ISIS sympathizers in Indonesia in the last few years, according to a 2017 report from the Institute of Policy Analysis and Conflict (IPAC).

“We’ve been seeing some evidence of the transition from Salafism to extremism among female extremists of the ISIS generation,” said Nava Nuraniyah, an IPAC researcher. “On the other hand, though, Salafi ulama [scholars] in Indonesia are among the most vocal opponents of extremism,” she said, suggesting that Salafism acts as a bridge to extremism for some even as it acts as a deterrent for others.

Saudi Arabia has long pushed the notion that its rigorous, state-sanctioned version of Islam is actually a bulwark against violent extremism, and has partnered with countries like the United States to fight terrorist groups from al-Qaeda to ISIS. But as Indonesia’s recent history shows, the distinction between Salafism and jihadism is not clear-cut.

“We need King Salman to make a clear and bold statement denouncing radicalism,” said Yahya Cholil Staquf of the moderate Muslim organization Nahdlatul Ulama. Otherwise, he said, “His visit will be easily perceived as more support to radical Islamic movements in Indonesia, as it is already a common public understanding that those radical movements take theological reference from Saudi Wahhabism and have been enjoying various kinds of support from Saudi Arabia.”

The Saudi ambassador, for his part, thinks such fears about the ideological impact of Saudi investment are off-base. “Wahhabi, Wahhabi, Wahhabi… people love to throw around this term without knowing what it means!” Alshuaibi told me. “They make baseless accusations. It is crazy!”

And some Indonesian leaders remain cautiously optimistic about closer ties with Saudi Arabia. “The two countries face the same challenge of rising radicalism and intolerance, so cooperation in those areas will be beneficial,” Yenny Wahid, a moderate Muslim activist, told Reuters.

Indonesia may be the largest stage for Saudi Arabia’s cultural diplomacy, but it’s hardly the only one. Saudi Arabia built satellite campuses for Egypt’s Al-Azhar university in the 1980s, funded Bosnian rebels and later built them schools in the 1990s, bankrolled numerous madrassas in pre-Taliban Pakistan and Afghanistan, and sent 25,000 clerics to India between 2011 and 2013. Al-Hattem, of LIPIA Jakarta, was previously stationed at Saudi outfits in Bosnia and Djibouti.

Observers have commented that the scales of power seem to be shifting in the Indonesia-Saudi relationship, so that the former is now theoretically in a better position to resist unwanted expansion than it was in the early years of its republic.

“Our economic condition now is very different, almost reversed, since the last Saudi visit,” said Luthfi Assyanukie, a liberal Muslim academic. “I think we can utilize that to prudently regulate Saudi investments.” Sila, from the Ministry of Religious Affairs, said, “I think the Saudi government needs Indonesia more now than vice versa, not least in terms of the revenue from hajj pilgrims.”

As Saudi Arabia’s economy fluctuates and it enforces austerity measures at home, will it ramp up its global efforts or scale them back? It may not matter.

“Salafi pesantren, and Saudi-inspired religious education in general, no longer necessarily rely on Saudi donations, as followers have become incredibly adept at raising money locally,” Chaplin said.

As the rise of hardliners, the Arabic language, and Salafi jihadist cells in Indonesia show, Salafism has some undeniable, durable appeal here. In Indonesia, at least, Saudi Arabia is already seeing the fruits of its labor. This new religious ecosystem may be self-sustaining.

Reporting for this piece was supported by a grant from the Pulitzer Center for Crisis Reporting.