Interior Secretary Donald Hodel yesterday hailed an agreement between the federal government and a group of California farmers over irrigation waste water that has poisoned a federal wildlife refuge, calling the compromise "good news" that should satisfy both agriculture interests and environmental groups.

The agreement means that 42,000 acres of the Westlands Water District in the western San Joaquin Valley will continue to get federal irrigation water this year and "into the future," Hodel said.

In return, the district agreed to stop the flow of polluted waste water from that land to the Kesterson National Wildlife Refuge, where it has killed and deformed hundreds of birds, and to find other means of disposing of toxic drain water.

Drain water from the western San Joaquin is laden with selenium, a naturally occurring element that has been washed from the soil by irrigation and has concentrated in the refuge at toxic levels.

"It is clearly a better solution than the one we had before," Hodel said. Two weeks ago, he announced that international wildlife-protection treaties left the government no choice but to cut off irrigation water and let the land revert to desert.

But the compromise, reached after 10 days of legal negotiations monitored anxiously by California congressmen, leaves questions unanswered. Among them are what will happen to the marshy refuge when irrigation drainage -- its only source of water -- is halted, and how much the cleanup is likely to cost the federal government.

The agreement stipulates that Westlands, one of the richest and most powerful water districts in California, will foot the bill for diverting its drain water elsewhere -- either through recycling or through new evaporation ponds built on farmland.

But cleaning up Kesterson's 1,200-acre reservoir, at a cost estimated as high as $600 million, apparently will be the federal government's responsibility. Hodel told reporters yesterday that he was "not equipped to make a suggestion" on how that cleanup should be financed.

Westlands spokesman William Johnston said the district had received estimates of $15 million to $25 million for its share of the work. "Hopefully, we'll devise something less expensive than that," he said.

The pact also leaves the way open for Westlands to sue the government for drainage of its entire 500,000-acre district, which Westlands officials contend was promised by the Bureau of Reclamation when it agreed to import irrigation water more than 20 years ago.

According to several sources familiar with the negotiations, the main sticking point during the last two weeks has been the Justice Department's unwillingness to promise all parties immunity from criminal prosecution under the Migratory Bird Treaty Act. That act makes it a crime to kill migratory waterfowl except during formal hunting seasons.

That obstacle apparently was overcome late Thursday night. A letter from Assistant Attorney General F. Henry Habicht II, released by the Interior Department yesterday, said the Justice Department believed that "no enforcement action would be warranted" under the cleanup plan.

However, Interior officials said the plan will take Kesterson out of service as a bird refuge for at least two years. "We're going to dry it up and then clean it up and there are no provisions beyond that," department spokesman Alan Levitt said.

Hodel said there are no plans to replace the polluted water that once fed the shallow marshes of the refuge with fresh water from the federally financed Central Valley Project, which supplies Westlands.

Selenium contamination in the valley, however, is not limited to Kesterson. High levels of selenium also have been found in the Grasslands, a privately owned but federally managed marshland adjacent to the Kesterson refuge. That area receives drainage water from other irrigation districts in the valley, and is unaffected by the Kesterson agreement.

Conservation groups, which had gone to court to force an immediate closing of Kesterson, said they were generally pleased with the agreement. But some called it a short-term solution to a problem that is expected to get much bigger.

"We're really talking about 500,000 acres down the road, and there's just no way to deal with all that water," said Laura King of the Natural Resources Defense Council.

The immediate winners under the agreement are the farmers in the 42,000 acres now draining into Kesterson, and their bankers, who held an estimated $64 million worth of loans on that land.

While Westlands officials said the water cutoff would have affected more than 250 farmers, there are actually 53 farms in the drainage area, and eight of those account for more than half of the 42,000 acres that stood to lose irrigation water.

More than one-fifth of the land is farmed by a corporation, Timco. Timco, with 9,579 acres in the drainage area, is controlled by the Wolfsen family, one of the wealthiest farming families on the West Coast.

The second largest is the J & J Ranch, the family farming operation of California state Assemblyman William L. Jones, a Fresno Republican. J & J Ranch farms slightly more than 3,000 acres in the drainage area.

According to figures from the Westland Water District, more than 60 percent of land in the drainage area is planted with cotton or wheat, crops that are in surplus.