So when the government and the reservation’s tribal leaders devised an agreement that would specify who was entitled to the water, and how much they could take from the reservoirs and ditches, there was bound to be some discord. But few people expected this.

There have been accusations of racism and sweetheart deals, secret meetings and influence-peddling in Helena, the state capital. Lawsuits have been threatened. Competing Web sites have sprung up. Some farmers have refused to sell oats to those on the other side of the argument.

For months, local newspapers have published letters from people who support the water deal — known as a compact — and from opponents who see it as a power play by the tribes to seize a scarce and precious resource from largely non-Indian farmers and water users.

The proposed compact is 1,400 pages long, a decade in the making and bewilderingly complex. Essentially, it helps to lay out the water rights of the tribe and water users like farmers and ranchers. It provides $55 million in state money to upgrade the reservation’s water systems. And it settles questions about water claims that go back to 1855, when the government guaranteed the tribes wide-reaching fishing rights across much of western Montana.

The tribes say they have given up claims to millions of gallons of water to reach the deal. They say it is the only way to avoid expensive legal battles that could tie up the state’s western water resources in court for decades to come.