Volkswagenwerk AG, the first foreign auto maker in modern history to build passenger cars in the United States, yesterday announced plans to close its only vehicle assembly plant in this country in mid-1988.

The shutdown of Volkswagen's sprawling facility in New Stanton, Pa., will eliminate 2,500 jobs -- 2,100 assembly and 400 administrative positions. The closing also is expected to cause layoffs at Volkswagen's U.S. headquarters offices in Troy, Mich.

The New Stanton plant produced Volkswagen Golf subcompacts and Jetta compact cars, both of which have been under withering competition from comparable, and often less expensive, models sold by Japanese, American, and South Korean auto makers.

The plant, operated by Volkswagen since 1978, has been running at less than half of its 200,000-unit annual production capacity in the last five years.

At present volumes, the New Stanton plant simply is not cost effective, Jay Amestoy, a Volkswagen spokesman, said. And because of the proliferation of cars in the U.S. small-car market -- at least 34 models competing against the Golf, for example -- sales of Volkswagen's New Stanton cars are not likely to increase in the future, he added.

"It's not that Volkswagen is giving up its U.S. franchise. It's just that they can't possibly continue to operate that plant on the amount of volume they're building there," said Donald DeScenza, auto industry analyst with Nomura Securities Inc. in New York.

Officials of Volkswagen's U.S. marketing arm said the planned shutdown will not affect the company's sales in this country.

"This year, we expect to sell 200,000 cars; and we expect to sell up to 220,000 in 1988," said Amestoy. Beginning in the 1989-model year, all Golfs and Jettas sold in America will be produced in West Germany, Amestoy said.

But more than production costs are driving that strategy, said Chris Cedergren, an analyst with J.D. Power and Associates in Westlake Village, Calif.

Volkswagen's Golf, New Stanton's main product, has an economy-car image but often does not sell at an economy-car price, Cedergren said. For example, the base-level 1988 Golf is $8,000. But the Korean-made Hyundai comes with many extras, such as air conditioning, at that price.

That means Volkswagen, maker of the famed entry-level Beetle, "is going to have to move upscale," Cedergren said.

And to do that, the company plans to capitalize on a still-popular American notion that cars that come from Germany are inherently superior to those produced in the United States, he said.

"It doesn't matter that the German-made Volkswagens have had as many or more recalls than the American-made models. It's not a question of reality. It's a question of perception. I mean, would you buy a Mercedes-Benz built in America?"

Volkswagen officials said they will try to find a buyer for the 2.3-million square-foot plant. But they conceded that the search could be extremely difficult because of excess capacity at a time when most analysts expect declining sales.

Auto industry analysts contend that the U.S. auto market will have 1.5 million units of unused assembly capacity by 1990, largely because every major Japanese auto maker will be building cars here by that time.

The entire North American market, of which the United States is the centerpiece, could have an excess capacity of up to 7 million cars and trucks in the early 1990s, some analysts say.