BEIJING — Torrential rains and floods across the southern half of China have besieged cities and towns for days. More than 160 people had died by Friday in drownings and landslides and as buildings collapsed, including 35 people buried by a landslide in the far west. Nearly two million people have been moved to safer ground while swollen rivers and lakes strain dikes and dams.

For China’s leaders, the floods are a test of their ability to deliver on their promises of safety for citizens.

The country’s flood defenses have faltered in the past, weakened by neglect and corruption, and Prime Minister Li Keqiang and other leaders have said that this year the government is better prepared than ever.

Yet experts and residents in areas hit by the rains have claimed that local governments have neglected drainage and filled in lakes, leaving cities exposed to greater flooding.