A Central American coffee company bought 18 million pounds of coffee in New York and shipped it to Brazil, in an effort to corner the market and drive up coffee prices, the Commodity Futures Trading Commission charged yesterday.

The action apparently helped keep up American coffee prices in the summer of 1977, when prices throughout the world were declining because of heavy production.

The incident is the latest in a series of attempts to manipulate coffee prices that are being investigated by the CFTC.

In a complaint made public yesterday, the commission accused firms located in El Salvador, Brazil, the Cayman Islands and New York of illegally manipulating trading on the New York Coffee and Sugar Exchange.

If the charges are upheld, the defendents could face civil penalties of up to $100,000 and could be barred from coffee futures trading.

CFTC sources described the manipulation as "a classic long squeeze" in which an individual controls such a large portion of the market that he can force others to pay artifically high prices.

The complaint charges the El Salvador firm, Compania Salvadorena de Cafe, controlled more than 85 percent of the coffee traded on the New York Exchange during three weeks of July 1977.

Earlier that year, the Salvadorean firm bought more than 600 coffee futures contracts, each calling for delivery of 37,500 pounds of coffee.

Although futures contracts are usually settled for cash, the Salvadoreans demanded delivery of the coffee, apparently creating a temporary shortage and driving up prices.

The complaint charges the firm took delivery of 679 contracts of coffee -- about 18 million pounds -- and shipped the commodity to Brazil. The complaint charges that Petrobas Comercio International-Interbras of Rio de Janeiro, Brazil, and a subsidiary, Interbras Cayman Company, of the Cayman Islands, aided in the scheme by handling the disposal of the coffee.

What happened to the coffee after it was shipped from New York to Brazil -- the world's largest coffee producing nation, with no need for coffee imports -- is not disclosed by the CFTC complaint.

The complaint charges the price manipulation was "aided and abbetted" by ACLI International, of White Plains, N.Y.; a subsidiary, ACLI International Commodity Services; and two ACLI executives, Lawrence J. Israel and Charles Hatten.

Also named in the complaint is Anderson Clayton Trading Co., a major New York commodity broker, Robert M. Jackson, a vice president of Anderson Clayton, and Michael D. Densen, a former broker for the firm.

Jackson yesterday declined to comment on the case complaint. The other parties could not be reached.

The complaint charges Anderson Clayton of placing coffee orders "at artificially high prices" and of handling other transactions which "they knew or should have known" were "for the purpose and with the intent of manipulating the market."

The CFTC also accused Compania Salvadorena de Cafe and its general manager, Ricardo Falla Caceres, of arranging for at least 479 illegal "wash sales" of coffee futures.

"A "wash sale" is a prearranged transaction that guarantees neither the buyer nor seller will lose money. Such transactions, DVTC officials said, can give the illusion that high prices are being paid for a commodity, when that is not necessarily the case.