Mexico has reached a deal to settle its water debts with the US despite widespread protests by Mexican farmers, some of which turned violent.
A bilateral treaty signed in 1944 says the two countries must share water sources along their arid border.
Mexican farmers say they need the water themselves, in what has been one of the driest years in decades.
But the US says Mexico has recently not been fulfilling the agreement and owed almost a year's worth of water.
Last month, hundreds of Mexican farmers seized La Boquilla dam in Chihuahua state to stop water being diverted to the US, leading to violent clashes with Mexico's National Guard.
A woman was shot dead in the unrest, in what the National Guard called "a regrettable accident".
Farmers in the US have been putting pressure on the Trump administration to make Mexico meet its obligations.
Mexican President Andres Manuel Lopez Obrador said Mexico would now make up its shortfall.
"If we need water for human consumption they will provide it and if we have a severe drought they will help us," he told reporters.
"I want to take the opportunity to thank the United States government for its understanding and solidarity."
Mexican farmers have been growing crops that use greater volumes of water from the Conchos river, which flows north into the US. It has taken 71% of the water despite only being allowed to use 62% under the treaty and letting the rest flow into the Rio Bravo, which is also known as the Rio Grande, AP reported last month.
Mexico has in the past delayed water payments in the hope that rainfall from Gulf of Mexico storms would make up the shortfall, AP said. However rain from Hurricane Hanna, which made landfall in July, did not move far enough inland to fill up dams in Chihuahua.