DENVER (AP) -- Farmers who faced a summer without crops because of a water-rights dispute have won a three-year reprieve from the state Legislature, a measure hailed as a major breakthrough ... The 35-year South Platte water war pits farmers who use wells against farmers downstream who draw water directly from the river into their irrigation systems. Taking water from the wells depletes the river to the point it interferes with the downstream farmers' use. Under water law, so-called "surface rights" are senior, or have priority over the right of well users. The measure passed Monday allows about 4,000 South Platte well users to continue operations if they acquire replacement water and go through a hearing process, which could take 35 days, according to the state engineer ... Attorney General Ken Salazar said the agreement ends one of the longest and hardest fought water wars in Colorado history. "The willingness of diverse parties to put aside over 35 years of past disputes provides a model for resolving western water wars," Salazar said. Lawmakers who opposed the bill said it sets a dangerous precedent and legitimizes a process that allowed junior water rights to override senior water rights. Rep. Carl Miller, a Leadville Democrat, said the crisis occurred because well users were allowed to break the law and take water to which they were not entitled.