A play that provoked bitter debate in West Germany over whether freedom of artistic expression should extend into anti-Semitic caricature was canceled tonight by Frankfurt's city theater after its management concluded that the risks of violent protests were too severe.

Following anguished consultations with city officials, Jewish leaders and the acting community, Frankfurt's theater director Guenther Ruehle announced that the play "Garbage, the City and Death," written in 1975 by the late film-maker Rainer Werner Fassbinder, would not be performed in the foreseeable future because of the need to preserve civic peace and secure working conditions for the theater.

The play, sharply attacked by the city's 5,000-member Jewish community as blatantly anti-Semitic and judged by many critics to be one of Fassbinder's inferior works, ostensibly was written in a fit of rage to satirize the rampant materialism perceived in one of the world's leading banking capitals. A central figure in the play is a greedy property speculator known simply as "the rich Jew."

The conflict over the play rekindled tensions between Jews and non-Jews in West Germany only six months after the painful Bitburg episode, when Jews and left-wing politicians urged Chancellor Helmut Kohl to cancel plans to lay a wreath with President Reagan at the Bitburg military cemetery, which contains the graves of Waffen-SS soldiers. Kohl ignored the protests and carried out the ceremony with Reagan at Bitburg.

This time, however, the ideological supporting roles were reversed. Political figures to the left of the spectrum endorsed the Fassbinder play production in the interests of artistic freedom for a new postwar generation of Germans. More conservative sectors attacked it for what they called its crude anti-Semitism.

The world premiere of the play was scheduled for Oct. 31. But two dozen of the city's 5,000 Jewish citizens occupied the stage when the curtain went up and refused to allow the performance to take place.

Frankfurt theater officials then tried to forge a compromise to enable the play to open without disruption on Wednesday night, but West Germany's intellectual community has been consumed by anguished argument over whether a truly free German society can permit itself to tolerate depictions of crude anti-Semitism in the guise of artistic license.

Many left-wing intellectuals, including Daniel Cohn-Bendit, former leader of the 1968 student revolt and himself a Jew, contended that 40 years after the Holocaust a new generation of Germans should be free to make their own judgments about portrayals of anti-Semitism.

Fassbinder, who died at 36 of an overdose of drugs, defended his play as an honest depiction of ugly racist tendencies that lay dormant within sectors of modern German society.

"The Jews have been taboo in Germany since 1945," the author wrote a year after his play was finished. "This can rebound on them, as taboos lead to darkness, secret fears and finally enemies." He admitted that anti-Semites were featured in his play but added that "unfortunately they exist also in Frankfurt."

In the play, "the rich Jew" buys up old houses, tears them down and replaces them with new ones at huge profit. He rationalizes the murder of a prostitute by noting that "the city needs the unscrupulous businessman who helps it change." He also observes that "the city protects me. It has to [because] I'm Jewish."

Another character in the play expresses regret that "the rich Jew" was not gassed by the Nazis. "He sucks us dry, the Jew," reads another line.

While critics have panned the play's crude content and generally poor quality, many have joined theater professionals in urging that the show be staged to demonstrate what is portrayed as the boldness and maturity of the new West German stage.

Ruehle insisted that the play does not extol anti-Semitism but merely illustrates the latent racism in modern society.

A fellow theater director in Hamburg, Peter Zadek, said, "One may, I think, dislike Jews without immediately building concentration camps." He noted that one of Fassbinder's most acclaimed movies, "The Marriage of Maria Braun," contained anti-Semitic slurs but was not subject to censorship.

In canceling the play, Ruehle said tonight that the heated dispute over Fassbinder's work "displays an irrationalism that stems in part from the crimes of Germans against Jewish citizens and the fears that have arisen from those crimes."

Michel Friedman, a spokesman for Frankfurt's Jewish community, said, "We welcome the theater's decision tonight with relief . . . . It will prevent further damage to relations between Jews and non-Jews in the city."

After stopping the first night's performance, Frankfurt's Jewish community had vowed to prevent any further showings of the play. Ruehle and city officials said repeatedly that they did not wish to be forced into a situation of calling in police to remove Jewish protesters forcibly.

The respected conservative newspaper, Frankfurter Allgemeine Zeitung, led an emotional campaign against the play.

Conservative politicians also attacked the play. Dieter Weirich, a spokesman for the Christian Democratic Union, said that "the picture of the evil Jew that this play conjures up is so dismaying that it justly causes indignation and sadness in all humane people."

Karl Schneider, minister of culture in the state of Hesse, which includes Frankfurt, said, "The feeling of those who have experienced the Holocaust is the reality, [and] no third party can decide what those people ought to be able to put up with in the name of freedom of art."

Frankfurt's conservative Mayor Walter Wallmann, who also appealed to Ruehle to abandon the production, told a synagogue service yesterday that even though he was opposed to the play, he could not ban it under West Germany's constitution.