I am determined to minimize any adverse impact on the American farmer from this action. -- President Carter, Friday, Jan. 4

They began gathering at the Agriculture Department shortly before 10 o-clock. It was a quiet Sunday morning in Washington, only 36 hours after President Carter had announced his embargo of 17 million metric tons of grain destined for the Soviet Union in retaliation for the Soviet invasion of Afghanistan.

The men who came to the Agriculture Department that morning were the barons of the grain trade, representing about 20 of the largest and most powerful grain companies in the country. And more important than their power was their knowledge. They knew what even the highest officials in the government did not: who owned the grain Carter had embargoed.

What the grain dealers told Agriculture Secretary Bob Bergland and other officials that morning led, almost exactly 12 hours later, to a decision at the White House of startling proportions. It was announced the next day by Bergland and Vice President Mondale: The U.S. government would buy up the enbargoed grain, all $2.25 billion worth of it.

It was not a decision the White House had initially sought. The president had ordered steps taken to protect American farmers from the economic consequences of the grain embargo. But in a frantic 48 hours of what one White House official called "policy making by the seat of your pants," it had become clear to the administration that to protect the farmers of Iowa and other grain producing states they would also have to save the grain companies.

They concluded this, the officials now say, because the grain dealers told them it was so and were able to back up that assertion with proof. The initial decision to halt shipment of the 17 million metric tons, said one presidential aide, "was drive by foreign policy considerations." Everyone knew the decision would have serious domestic repercussions.

But the extent of those repercussions did not become known fully until the Sunday morning meeting and later the same day, when the representatives of the grain companies went over their contracts for grain purchases in individual private sessions with Agriculture Department officials. The grain companies estimated their losses -- some, according to the government officials, would have gone bankrupt -- and argued that those losses would reverberate down through the whole trading system, finally reaching the farmer.

The process had begun the previous Wednesday, Jan. 2. Carter had not finally decided to order the partial embargo, but it was a likely option. At the president's direction, White House domestic policy adviser Stuart E. Eizenstat and Agriculture Department officials went to work on possible measures to cushion the domestic impact.

By Friday night, when Carter announced the partial embargo, a list of measures to protect the domestic market had been devised. While the exact mix of these measures was yet to be worked out, its general thrust was clear: There would be some limited government purchases of grain, for example for Food-for-Peace program purposes, but the government would try to keep most of the 17 million metric tons off the domestic market, where it would depress prices, by encouraging farmers to place the grain in the farmer-held reserve.

Under the reserve system, farmers are paid by the government to keep grain off the market and store it; they use the stored grain as collateral for government loans. By increasing the storage fee and making the loan rates more favorable, a senior White House official said, "the original idea was to entice this grain into the reserve."

There was only one problem -- the farmers didn't own most of the 17 million metric tons that the president had embargoed. The grain companies did. Weeks and months before, the grain companies had signed contracts with grain elevator companies for delivery of virtually the entire 17 million metric tons.

The grain elevators, in turn, had contracted with farmers in their area for delivery of the grain. Moreover, all along the chain, many of these contracts were mortgaged -- sitting in bank vaults as collateral for operating capital loans to farmers, grain elevators, even the giant grain companies.

There was a second complicating factor. Most of the grain had been bought at prices higher than last week's market prices. If the 17 million metric tons were sold, the losses would run into the hundreds of millions of dollars, not just to the grain companies, but again all along the chain.

And sold they would be because of the presidential order. The grain companies told Bergland that their own bankers would insist that the 17 millin metric tons be dumped back on the market, to recover as much as they could.

These crucial factors were not known to administration officials Friday night as the president announced the partial embargo. Some officials say they suspected almost from the beginning that a total government purchase would be necessary. But at the Agriculture Department, the preference was to limit the amount of the government purchase. Farmers, whom the department represents, don't like the government buying grain, fearing that a large government-held grain reserve would later overhang the market and depress prices.

That perspective quickly changed over the weekend. As the grain dealers made their case to Bergland Sunday morning, said a White House official who attended the meeting, "it became immediately obvious that what we had proposed was not going to protect farmers."

"The agricultural economy is highly integrated, from producers to the elevators to the exporters," said another official. "We had been concentrating on one end of the chain, the farmers. But it became obvious you could not deal with one end of the chain only."

From the Sunday morning meeting, events moved rapidly. While Agriculture Department officials questioned the individual grain dealers, Bergland, Eizenstat, White House counsel Lloyd Cutler and Council of Economic Advisers chairman Charles L. Schultze conducted a telephone conference call.

They decided to recommend a closing of the grain markets on Monday and Tuesday -- which was accomplished later that day in an order from the Commodity Futures Trading Commission -- and that Bergland should develop a recommendation for additional steps to cushion the impact of Carter's decision.

At 8 o'clock Sunday night, the major players convened in the Roosevelt Room of the White House. They included Bergland, Eizenstat, Cutler, Schultze, Treasury Secretary G. Willliam Miller and budget director James T. McIntyre.

The meeting lasted almost three hours. There were many questions to Bergland about this strangely complicated world of grain trading. But in the end, officials say, there was no argument.

"The conviction kept growing over the weekend and in the end it became unanimous," one senior White House official said.

Hastily, late that night a 1 1/2 page memo was written under Eizenstat's name recommending the government purchase and sent to the president's office, where he approved it Monday morning.

The chain reaction had begun in a remote, desolate country thousands of miles from the corn fields of Iowa and the rows of wheat in Kansas. It would strike first the giant grain companies and their powerful commercial creditors, interests that did not immediately elicit sympathy. But soon enough in this election year, it would strike also the county grain elevator operator in his office by a railroad siding, and the farmer in his field.

"It turned out not to be a hard decision," a White House aide said.