By Tom Allard and Agustinus Beo Da Costa

JAKARTA (Reuters) - Students at an Islamic school that Indonesian authorities have linked to Islamic State returned home after villagers nearby demanded its closure, a school spokesman said on Sunday.

A Reuters investigation published this month found at least eight staff and four students from the Ibnu Mas'ud school in Sukajaya, West Java either traveled or tried to travel to Syria to join the jihadist group between 2013 and 2016.

Spokesman Jumadi told Reuters the school was empty after the local police chief said failure to comply with the closure demands would lead to a "big demonstration" by residents from five surrounding districts.

The school denies it supports IS, or any other militant groups. It also says it does not advocate a violent or extreme version of Islam.

Jumadi, who goes by only one name, said the police warning prompted the school to call parents to pick up the roughly 250 students.

Police could not be immediately reached for comment.

One of the four students, Hatf Saiful Rasul, left for Syria when he was 11 and died fighting with IS a year later in September 2016. His father, imprisoned militant Syaiful Anam, wrote that his son was inspired to travel by teachers and students of the school who had joined IS.

During the school's decade of operation in Depok, outside Jakarta, and then at Sukajaya, at least another 18 people with links to it have been convicted or are now under arrest for militant plots and attacks in Indonesia, Reuters reported. They include former students, teachers, parents, founders and donors.

During its investigation, Reuters reviewed court documents, deeds of entitlement and interrogation reports, and interviewed counter-terrorism police, donors and former militants.

MEMORIZING THE KORAN

School head Agus Purwoko told reporters last week it only taught pupils "how to read and memorize the Koran."

"So Ibnu Mas'ud, in a way, is a childcare. There are also parents who send their kids here because they are divorcing, going to jail, or facing other problems."

Sukajaya village chief Wahyudin Sumardi told Reuters in July that residents had been concerned about activities at the school for years.

Local resentment ignited when a member of the school's staff allegedly burned a red and white banner in the village celebrating Indonesia's Independence Day on Aug. 17.

Irate residents rallied outside the school, according to police, village chief Wahyudin and school spokesman Jumadi.

Jumadi agreed the next day to move or close the school in a month. But school head Agus and some rights activists said he signed documents under duress and the school should not be closed on the basis of minor damage to patriotic bunting.

"We asked the police to prevent the mass protesters taking the law into their own hands and to separate the activities of the children from allegations of involvement in terrorism," said Usman Hamid, director of Amnesty International Indonesia.

Hamid said the school's closure would increase the students’ chances of being radicalized.

(Additional Reporting by Jessica Damiana; editing by John Stonestreet)