Mexico said Thursday that it had reached an agreement with the United States to settle a controversial water debt, after protests by farmers near the border turned violent. The government has been caught between US pressure to meet an October 24 deadline under a water-sharing treaty and public opposition in Chihuahua state, where a demonstrator was killed. President Andres Manuel Lopez Obrador said his country would fulfil its obligations in return for a commitment from the United States to provide Mexico with water in the event of shortages. "If we need water for human consumption they will provide it and if we have a severe drought they will help us," Lopez Obrador told reporters, thanking the US for its cooperation. Protesters have occupied the La Boquilla dam in Chihuahua since September 8, saying they fear a drought will ruin their crops. Seventeen soldiers were detained for investigation after a woman was shot dead in the unrest. The National Guard called her death an "unfortunate accident." Under the pact dating back to 1944, the neighboring countries share water from two major rivers flowing from the southwestern United States to Mexico, the Colorado and the Rio Grande. The United States complained last month that its neighbor owed almost a year's worth of water needed for crop irrigation, municipal water supplies and industry. Texas Governor Greg Abbott wrote to US Secretary of State Mike Pompeo to ask him to intervene to ensure Mexico complied with its side of the deal. Lopez Obrador, who has sought to maintain good relations with the US, sees political motivations behind the unrest ahead of next year's gubernatorial elections. sem-dr/ft