At least 40 people have died and hundreds of thousands have been evacuated as floods hit vast swathes of central and eastern India.

Days of heavy rain have caused the Ganges River and its tributaries to rise above the danger level during the past 48 hours in about 20 districts of the states of Madhya Pradesh, Bihar and Uttar Pradesh.

Officials said at least 17 people have died in Madhya Pradesh, 14 in Bihar and nine in Uttar Pradesh due to drowning, electrocution, or injuries sustained when houses collapsed.

In the city of Allahabad, water from the Ganges entered many residential areas, forcing people to move to safer areas. About 12,000 people were evacuated from low-lying surrounding villages, a government statement said.

In the Hindu holy town of Varanasi in Uttar Pradesh, flooding forced a halt to cremations at a main riverfront area, District Magistrate Vijay Karan Anand said. Devout Hindus bring dead family members to Varanasi in the belief that being cremated there frees their soul from the cycle of death and rebirth.

In Bihar, 600,000 people were evacuated and the army and air force are on standby because more rain is forecast in the next two days.

Floods occur in many parts of India during the monsoon season, which runs from June to September.