LOS ANGELES, March 21— Elia Kazan said ''thank you'' tonight at the Academy Awards, and then walked off stage slowly to sustained applause.

It was, in some ways, a bittersweet finale to the controversy over the honorary Oscar for the 89-year-old filmmaker, a controversy dating back to 1952 when Kazan, the director of ''On the Waterfront'' and other classics, named names before the House Un-American Activities Committee investigating Communist influences in Hollywood.

Tonight, Mr. Kazan was introduced by Martin Scorsese, the director, and the actor Robert De Niro. ''He was the master of a new kind of psychological and behavioral truth in acting,'' Mr. De Niro said. ''The work that he did brought a thrilling new reality to the stage and screen.''

Although the television audience saw several actors, Nick Nolte and Ed Harris among them, remaining seated and not applauding Mr. Kazan, many members of the audience stood and clapped as Mr. Kazan walked slowly onstage. Such actors as Warren Beatty, Kathy Bates, Karl Malden, Meryl Streep and Helen Hunt stood and joined the applause.

Mr. Kazan spoke briefly, thanking the academy for its ''courage and generosity.'' He then hugged Mr. Scorsese and Mr. De Niro. Mr. Kazan was accompanied onstage by his wife, Frances Kazan.

Earlier, about 250 demonstrators outside the Dorothy Chandler Pavilion protested Mr. Kazan's Oscar.

Bernard Gordon, an 80-year-old formerly blacklisted screenwriter and a leader of the protest, said he was appalled at the unanimous decision by the 39-member board of the Academy of Motion Picture Arts and Sciences to give the award to Mr. Kazan.

''We're demonstrating because up to a billion people around the world will be watching the academy ceremony and we don't think the message should be one of glorifying a man who did so much damage to our community,'' Mr. Gordon said. Asked if he was surprised that the Kazan issue had become such a source of debate in Hollywood, Mr. Gordon said: ''It's astonishing. We didn't anticipate it. It's because there's so much interest in the Academy Award itself. If it was a bunch of film critics no one would care.''

Another demonstrator, Bob Lees, 86, also a formerly blacklisted writer, said: ''Kazan could have worked. He didn't need to have talked. Kazan should apologize.''

Nearby, about 75 people supporting Mr. Kazan chanted and carried placards. The demonstrations, under police guard, were across the street from the red carpet where celebrities paraded before cameras as they entered the auditorium.

Mr. Kazan, who is a bit frail, avoided the red-carpet entry to the ceremony, where hundreds of photographers and reporters awaited the arrival of movie stars. Instead, he arrived with his family at a side entrance and slipped into the auditorium.

No Academy Award, honorary or not, has generated as much debate as the one for Mr. Kazan, who has lived in New York for years. His supporters, including Mr. Malden, who worked for Mr. Kazan in ''On the Waterfront'' and proposed the award, said Mr. Kazan's work was so formidable and influential that the academy should honor him in the twilight of his life. Mr. Kazan has already won Oscars for his direction of ''Gentleman's Agreement'' (1947) and ''On the Waterfront''(1954).

His other films included ''Viva Zapata'' (1952), ''Baby Doll'' (1956), ''A Face in the Crowd'' (1957) and ''Splendor in the Grass'' (1961).

Many producers, executives and politically engaged stars like Mr. Beatty have expressed ambivalence about the award, saying, in essence, that it is difficult to make judgments now about the pressures Mr. Kazan and others faced. ''Although you and I might feel he made a mistake,'' Mr. Beatty said, ''neither you nor I were around in that period.'' Mr. Beatty's first film was Mr. Kazan's ''Splendor in the Grass,'' and it made him a star.

But critics of the award to Mr. Kazan said that the director should not be forgiven for the decision he made in 1952. A full-page ad in Daily Variety, signed by some members of the entertainment world as well as lawyers and academics, said that Mr. Kazan ''validated the blacklisting of thousands'' and that ''his action did enormous damage to the motion picture industry.''

Only a handful of the hundreds of signatories were well known, among them the actors Sean Penn, Ed Asner and Theodore Bikel.

Photo: The director Martin Scorsese hugs Elia Kazan, the influential postwar film director and an honorary Oscar winner. (ABC)