Peter Weiss, 65, author of the widely hailed "Marat-Sade" and other plays and one of Europe's most influential dramatists in the postwar era, died in a hospital in Stockholm May 10 after a heart attack.

Mr. Weiss's view of the world was shaped by the chaos and violence that have characterized so much of 20th century life. He and his family had fled Nazi Germany--his father was a Jew by birth and a Christian by conversion. The mindless brutality of World War II, particularly the Holocaust in which 6 million Jews were exterminated, led him to try to reconcile freedom and responsibility in the broadest human terms.

"I feel guilty because I was not being punished as others had been for their Jewish blood," he said in an interview with Life magazine in 1966. "I was horrified at my attitude on leaving Germany."

Mr. Weiss also was a self-proclaimed Marxist. For him, it was a humane and personal guide to behavior rather than an orthodox and oppressive one. He visited Vietnam and Cuba, was critical of American policies in these countries and elsewhere, and in 1965 issued a statement of support for the communist world. But he denied to Life that he was a Communist, saying, "True Marxism is always humanism and as a Marxist I would never agree to suppression of expression wherever it came from."

A painter, journalist, film director and novelist in his earlier years, Mr. Weiss eventually turned to writing for the theater and he drew heavily on the threads of his own life for his themes. His first play, "Marat-Sade," which appeared in 1963, established his reputation.

"The Persecution and Assassination of Jean Paul Marat as Performed by the Inmates of the Asylum of Charenton Under the Direction of the Marquis de Sade," as it is called by its full title, is the story of two historic Frenchmen of the 18th century whom Mr. Weiss saw as apostles of the opposing creeds of the modern man. Set in the tiled bathhouse of a lunatic asylum, it consists largely of a witty and pointed debate on the nature of revolutionary politics.

The implication is that the world today, like the world of the French Revolution, is a madhouse. The two forces fighting for supremacy in this universe are represented by Jean Paul Marat, the revolutionary idealist who for mankind's own good is willing to kill on a grand scale, and the Marquis de Sade, the extreme individualist who championed self-indulgence--and hence anarchy--as man's natural right.

The play opened in West Berlin's Schiller Theater in April 1964 to critical and popular acclaim. European producers Peter Brook, Ingmar Bergman and Roger Planchon volunteered to stage it in other cities and it became a continent-wide success. It also was staged with success in this country.

The next play written by Mr. Weiss, "The Investigation," was a dramatization of trials held in Frankfurt in 1964 and 1965 concerning the systematic torture and murder by the Nazis of 4 million people, the great majority of them Jews, at the Auschwitz extermination camp. The word "Jew" is not used in the play, for it is an effort by Mr. Weiss to universalize the victims and their tormentors. He tries to make the point that Auschwitz was a crime committed not merely by Germany, but by humanity.

Later plays by Mr. Weiss deplored colonialism in Angola and dealt critically with American actions in Southeast Asia.

Mr. Weiss was born near Berlin. His father, who was born in Czechoslovakia, was a wealthy textile manufacturer. His mother was Swiss. In 1934, the family moved to Sweden, where they again prospered. After completing his studies at the Academy of Art in Prague, Mr. Weiss became a Swedish citizen.

He later wrote that he became impatient with his family's bourgeois way of life, broke away from them and settled with other German refugees in Stockholm. He wrote for Swedish journals, then traveled in postwar Germany. He returned to Sweden to begin his career as a playwright, writing in the German language.

"Perhaps I am the perpetual refugee--physically from the Nazis; then from the frustrations of the Swedish language; now emotionally and morally from the new Germany," he told an interviewer. "They always called me an outsider in Sweden , you know. I am--everywhere, I think."

In 1964, he married Gunilla Palmstierna, a Swede who helped him financially, designed sets and costumes for his plays, and directed the Stockholm production of one of them. She survives him.