Led by General Motors Corp., the nation's auto makers have engineered an estimated $2 billion tax savings by exploiting a loophole in the 1986 tax act that was intended only for a struggling Farm Belt tractor maker.

GM, Ford Motor Co. and Chrysler Corp. moved quickly to qualify for the tax break: They quietly rejiggered the way they do business with their dealers only days after the Tax Reform Act was signed by President Reagan, in order to meet a deadline in the law. "There was a door in it big enough for everybody to drive through," said one auto executive.

And then, just to make sure, the auto makers successfully lobbied late last year for a congressional guarantee that the exception applies to them. It was included in the 1,033-page tax-and-spending act passed just before Congress departed for Christmas.

Auto executives said they are only taking advantage of a perfectly legal tax benefit to which they are entitled by the language of the law. The guarantee, they said, was intended only to ensure that the one-time tax savings would not be repealed by the 1987 act. The $2 billion figure is an unofficial industry estimate.

GM was the first company to discover that the exception in the 1986 tax law, originally intended only for Deere & Co. of Illinois, could apply to other firms because its wording was sufficiently vague. GM also lobbied heavily for the clarification of the wider applicability of the exception in last month's law.

Although GM contracted for a legal analysis from the law firm of Dewey, Ballantine, Bushby, Palmer & Wood, congressional sources and others said credit for the coup belongs to GM's own lobbyists, who met privately last fall with House Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.) and other House and Senate tax writers.

GM officials pointed out that if Congress had wanted the exception to apply only to Deere, manufacturer of the well-known John Deere tractors and other farm equipment, the provision easily could have been written more narrowly.

"My belief is that Congress basically declared that if you qualify for the exception you are entitled to the exception," said GM Washington representative Bruce Rogers.

Sen. Charles E. Grassley (R-Iowa) inserted the exception -- related to tax advantages for selling to dealers on installment -- on Deere's behalf in the original Senate version of the tax revision. There was no objection, presumably because few in Congress were opposed to assisting the shaky farm sector.

The opportunity for the automakers presented itself because the Deere exception, like many special tax benefits, was written in a way that bestowed the largesse without specifically naming the designated beneficiary.

The tortured language of the provision instead set out a series of qualifying conditions applying to a company selling to dealers.

The conditions had to be in place by Jan. 1, 1987, and only a handful of companies knew enough about the provision to quickly restructure their business.

"Everyone did it within 15 minutes after the law was passed," said an auto official.

The loophole exempts Deere -- and any other company that, like the auto makers, restructured before the deadline -- from a provision ending the practice of postponing taxes on profits from goods sold on an installment basis.

Generally, an auto company is not fully paid for the cars it ships to dealers until the cars are sold. Under the old tax code, if the car were shipped one year and sold the next, the auto company would not have to pay taxes on the income from the sale until it received the full payment, in the second year.

The 1986 law changed that system by requiring manufacturers, retailers and others to assume for tax purposes that they were fully paid in the tax year in which they received the first payment. The loophole was crafted to permit companies that allow the seller to buy the item back in nine months or less to continue the tax deferral -- a system Deere already practiced with its dealers.

Technically, the exception only allows auto makers to postpone paying the taxes. But its effect is the equivalent of a tax cut because the taxes can be deferred every year for an indefinite period of time.

GM, Ford and Chrysler added the nine-month provision to their dealer arrangements after the law passed in late 1986.

Then came 1987, and legislators began looking for taxes to raise to reduce the federal deficit. One of the items on the list was a further crackdown on installment sales, and proponents of the exception feared that their break might be removed. The guarantee was part of a package proposed by House members during negotiations with the Senate over the tax bill in December, but sources would not say who inserted it.

Congressional sources said federal tax collections could be reduced by a "substantantial" amount if the loophole is not narrowed.

"People didn't have in mind that GM would qualify," said one congressional aide familiar with the issue. "If they had, they would have drafted it a different way."

Burton B. Smoliar, associate general counsel for Ford, said the law is not entirely clear and Ford could not be sure the exception said what it seemed to say. However, he said, he was sure of one thing: The provision does not discriminate against Ford.

"If it applies to people similarly situated to us, it applies to us," he said.

John Loffredo, chief tax counsel for Chrysler, agreed: "All Chrysler said was that we wanted equal treatment with other companies."