For much of the last two years, Sen. James A. McClure (R-Idaho) has tried to get the Justice Department to be more generous in compensating a half-dozen Idaho investors for a narrow strip of land that the government contended was worth no more than $321,000.

Just before Christmas, McClure found a quicker way to give his constituents what they sought: he slipped a $3.9 million payment for the same land into the continuing budget resolution that Congress passed before adjourning.

His legislative solution abruptly ended the Justice Department's efforts to negotiate a settlement with millionaire sawmill owner John Edwards and his partners in Edwards Investments, which is selling the government a former railroad right-of-way in northern Idaho.

Frank M. Cushing, staff director of the Senate Energy and Natural Resources Committee, which McClure chairs, said the senator disputes the way the government appraised the land and felt that the negotiations were going nowhere. Requests for comment from McClure were directed to Cushing.

McClure intervened "because he thinks it's right," Cushing said. "He thinks Edwards was getting screwed by the government . . . . We think it's a fair deal for the taxpayers."

Cushing said McClure has never met Edwards but knows Edwards' chief attorney, Thomas C. Morris, a Republican and longtime friend and supporter. Asked why Edwards should not defend his claims in court, Cushing said, "Who in their right mind is in a position to fight the Justice Department for the rest of their life?"

But Anne H. Shields, acting legislative chief of the Justice Department's Lands and Natural Resources Division, called the $3.9 million "a hefty sum . . . . It's obvious we don't have the same notion as to the value of those holdings."

Shields' boss, Assistant Attorney General F. Henry Habicht II, declined comment, saying the matter may still wind up in litigation. In a December letter, however, Habicht told McClure that his department could not "find any basis in law or fact for the value of $4 million."

Officials at Edwards Investments, which rejected the Justice Department's final offer of $650,000, did not respond to requests for comment.

The story of this 100-foot-wide strip, formerly owned by the bankrupt Milwaukee Road Railroad, shows how a highly technical land dispute can escalate into a political tug of war. It began in 1982 when Edwards, who owns a sawmill in St. Maries, Idaho, joined with some partners to buy parts of the railroad right-of-way in a bankruptcy sale.

When the purchases were complete, Edwards claimed ownership of 1,300 acres of right-of-way from Avery, Idaho, to St. Regis, Mont., and said he planned to upgrade an existing road into a timber-hauling route.

But the 56-mile route also passed through two national forests, and the Forest Service decided to build its own logging road and began condemnation proceedings. Soon afterward, the Justice Department determined that Edwards owned only about 500 acres along the right-of-way and that the federal government already owned the remaining 800 acres.

Department officials said the government had given the Milwaukee Road the right to use the land when it built its transcontinental route, but that under an 1875 law the land reverted to federal ownership once it was no longer being used for railroad service. The deeds that Edwards bought, they said, did not give him title to that land.

Edwards insisted that he owned all the land, had made improvements and that it was now worth $24 million, which is what he said it would cost the Forest Service to build a logging road from scratch. His staff made several trips to Capitol Hill and drove a McClure aide along the route in a Cadillac to demonstrate its smoothness. Cushing said the government valued Edwards' holdings "as teeny little pieces of land. They should have appraised it as a road system." The scrap value of equipment on the road is at least $6 million, he said.

When negotiations lagged last summer, McClure and Sen. Steve Symms (R-Idaho) wrote to Attorney General Edwin Meese III, saying they might hold hearings on the issue in McClure's Energy Committee. McClure later met with Meese on the subject.

But the Justice Department stood firm, saying that Edwards had refused to disclose how much he paid for the land. While Edwards talked of spending $1 million, officials said records showed he had paid no more than $363,000.

Justice officials also ridiculed Edwards' other demands for more than $4 million in compensation. In an internal report, they cited:

*$40,000 in travel costs. "There is no reason to pay the costs for Edwards to lobby Congress and the executive in high style," the report said.

*$175,000 in professional fees. Justice questioned why the government should pay for Edwards' legal fees, saying that two of his lawyers are also partners in Edwards Investments.

*$1.6 million for rails and ties on the route. "Edwards never purchased and never owned the rails and ties . . . . There is no conceivable reason to include this as a cost to Edwards (except that it is necessary to push the total above $4 million)."

In December, Lands Division chief Habicht wrote McClure, "We are quite confident that a court would find that Edwards owns only scattered pieces of the former right-of-way." He said a Forest Service appraisal valued the parcels that Edwards owned at $321,000, and that the department would offer $650,000 as "a generous concession for litigation risk."

But McClure, who also chairs the Appropriations subcommittee on the Interior, had already put the $4 million payment into the panel's spending bill. When the bill was submerged into a continuing budget resolution, a leading House conferee, Rep. Sidney R. Yates (D-Ill.), tried to block the payment as a windfall.

After more than two hours of debate over one of the smallest items in the bill, McClure won agreement for the government to buy the disputed land for $3.9 million