CORONADO, Calif. — The governments of the United States and Mexico signed an agreement on Tuesday to overhaul how the two countries share and manage water from the Colorado River, which provides water to more than 33 million people in seven states and Mexico.

Under the agreement, the two countries will share in both surpluses and water shortages. During drought years in the United States, less water will be sent to Mexico. In exchange, during years of plenty, Mexico will be allowed to store some of its water north of its border.

In addition, the countries will allocate some water to restore the ecological health of the river’s delta in Mexico.

Speaking at the signing of the agreement here, Interior Secretary Ken Salazar called it the most important adjustment to rules on the Colorado River since the 1944 treaty between the two countries that set the terms for use of the river’s water.