Torrential rain has triggered floods and landslides on the Indonesian island of Java, killing at least 20 villagers, an official said.

The worst-hit district was West Java's Garut, where 17 people were found dead and 13 others were missing after two rivers overflowed on Tuesday night.

The dead in Garut included an eight-month-old baby and eight other children, the National Disaster Management Mitigation Agency said.

Agency spokesman Sutopo Purwo Nugroho said about 1,000 villagers were evacuated to army barracks and other temporary shelters.

He said three villagers were killed in Sumedang district and one person was missing after landslides buried two houses and destroyed a mosque. About 100 villagers were evacuated.

More than 30 villagers were injured in the two districts, Nugroho said.

He said heavy downpours were expected to continue and increase until January, partly because of La Nina, the flip side of El Nino, which has a general cooling effect.

Rains frequently cause landslides and widespread flooding in much of Indonesia, an archipelago where millions of people live in mountainous areas or on flood plains near rivers.