At least eight students have been killed and two others are missing after a flash flood hit a high school group who were hiking along a river on Indonesia's main island of Java, a rescue official has said.

About 250 students were trekking on the banks of the Sembor River in Donokerto village in Sleman, Yogyakarta on Friday when high waters pulled some students in, drowning them.

More:

"Rescue team personnel have found eight bodies and are still looking for two more that are still missing," said Yogyakarta Search and Rescue Agency (Basarnas) head Lalu Wahyu Effendi on Saturday, as cited by the Jakarta Post.

The group was not aware of the changing weather conditions upstream and developing thunderstorms, according to a National Disaster Mitigation Agency (BNPB) spokesperson.

"Students were doing scout activities around the Sempor river," Agus Wibowo, spokesman for the BNPB, said in a statement on Friday.

A local military chief told TVOne that most of the bodies were found a short distance down the Sembor River from the site of the flood. He said a downpour burst the river's banks, causing the flood.

He said 239 students were rescued, including 10 who were treated for injuries.

Wibowo said it was not raining when the students came down to the river but as they walked around it "huge waves came upstream".

He added that joint forces comprising the police, search and rescue agency and military had been dispatched to assist in search and rescue.

Rains cause frequent landslides and flash floods in Indonesia, where millions of people live in mountainous areas or near flood plains.