Flagstaff, Ariz.A dispute between two major California water agencies is threatening to derail a hard-won agreement designed to protect a river that serves 40 million people in the U.S. West.

The Imperial Irrigation District, the largest single recipient of Colorado River water, on Tuesday sued a Los Angeles water utility that agreed to contribute most of California’s share of water to a key reservoir under a multistate drought contingency plan.

The action came the same day President Donald Trump approved federal legislation to implement the plan, which Arizona, California, Colorado, Nevada, New Mexico, Utah and Wyoming spent years negotiating.

The agreement is meant to keep the country's two largest reservoirs on the Colorado River from dropping so low they cannot deliver water or produce hydropower amid prolonged drought and climate change.

The Imperial Irrigation District said it wouldn't join the drought plan unless it secured $200 million in federal funding to address health and environmental hazards at the Salton Sea, a massive, briny lake southeast of Los Angeles.

The Metropolitan Water District, which serves Los Angeles, essentially wrote Imperial out of the drought plan to prevent delays in implementing it. It took on the amount of water that Imperial pledged to contribute to Lake Mead. With that, Metropolitan's contribution could top 2 million acre-feet through 2026 when the drought plan expires. An acre-foot is enough water to serve one to two average households a year.

Imperial's lawsuit claims the Metropolitan Water District sidestepped an environmental law.

"Where the water supply would come from and what environmental impacts could result from Metropolitan's need to acquire such water to fill this sizable hole in its water supply are entirely unknown," Imperial wrote in court documents filed in Los Angeles County Superior Court.

A California law requires state and local agencies to identify any potential environmental effects of their actions and address them if possible. Imperial is asking the court to force Metropolitan to comply with that law, which could delay the larger drought plan from being implemented.

Metropolitan has said storing water in Lake Mead under the drought plan doesn't require review under the California Environmental Quality Act because any changes to its facilities would be minor.

"We are disappointed that the Imperial Irrigation District is using litigation as a tool to block implementation of the drought contingency plan," Metropolitan general manager Jeff Kightlinger said in a statement Wednesday. "Parties on the Colorado River need to collaborate during this time of crisis, not litigate."

Imperial took the stance in December that the drought plan would be exempt from the environmental law. District spokesman Robert Schettler said Wednesday that came before Metropolitan strayed from a version that Imperial approved with stipulations.

The seven states and U.S. Bureau of Reclamation have said the drought plan won't affect the Salton Sea, but the Imperial Irrigation District isn't convinced.

"The logic in going forward without IID was that the DCP (drought contingency plan) couldn't wait for the Salton Sea," general manager Henry Martinez said Wednesday. "This legal challenge is going to put that logic to the test, and the focus will now be where it should have been all along, the Salton Sea."

Tom Buschatzke, director of the Arizona Department of Water Resources, said it's unclear what would happen if a California judge sides with Imperial and prohibits the Metropolitan Water District from signing final documents for the drought plan.

"We certainly will have to have some conversations among the basin states and Reclamation on how to move forward and what we can or can't do at that point in time," he told reporters in Phoenix.

The states were expected to sign final documents next month in line with a timeframe for Mexico also to begin contributing water next year, Bureau of Reclamation spokeswoman Patti Aaron said. She said the agency is reviewing the lawsuit for its potential effects but declined to comment on it.

Associated Press writer Jonathan J. Cooper in Phoenix contributed to this report.