BEIJING — Seven officials in southern China have been removed from their jobs in the wake of a toxic heavy metal spill that fouled drinking water supplies for tens of millions of people, the state news media reported Friday.

The spill, which affected 200 miles of the Longjiang River in the Guangxi Zhuang Autonomous Region, was caused by two companies that accidentally released tons of cadmium into the river last month. The contamination was not reported for at least two weeks, during which people continued to use the water for drinking and cooking.

Cadmium, a poisonous component of batteries and other industrial products, can cause kidney failure and bone damage.

According to the official Xinhua news agency, among those fired from their jobs was the head of environmental protection in the city of Hechi, which failed to report the spill and then botched the attempted cleanup. Several other officials, including the city’s deputy mayor, were reportedly disciplined. The police have also arrested six people at the Hongquan Lithopone Factory and the Jinhe Mining Company, which are blamed for the spill. Four other managers at the companies have fled, Xinhua reported.