Joseph Heller, 76, the novelist, playwright and teacher who will be best remembered for his brilliantly hellish and hilarious first novel, "Catch-22," died Sunday at his home in East Hampton, N.Y., after a heart attack.

"Catch-22," a World War II novel that was published to mixed reviews in 1961 but went on to be a popular classic, became a touchstone for a generation coming of age in the 1960s under the shadow of a very different war. Both the book and the new generation viewed authority, especially military authority, with something that ranged from bemused disbelief to contempt.

On one level, the book was a war story that told of the bloody air operations in the Mediterranean during World War II. On another level, it illustrated the utter insanity of war. The title rapidly entered the national vocabulary, conveying the sardonic flavor of the book to millions who would never read it. With an irony that was amused as much as bitter, the phrase suggested the futility of much human effort, implying that the very act of trying to attain a goal often prevented it from being reached.

When "Catch-22" was published, reviews compared it unfavorably with other World War II novels such as Norman Mailer's "The Naked and the Dead" and James Jones's "From Here to Eternity." Next to those works, Heller's offering seemed both odd and unreal.

Reviewers maintained that the writing, while often hilarious, was often choppy and confusing, and that the bewildered everyman protagonist, Yossarian, and other, often buffoonish and evil Army Air Forces officers were unlike the "real" military. Critics also found the anti-war message of the novel untrue to the almost crusadelike spirit with which most of this country went to war in 1941.

However, the novel acquired a fervent following, including the legendary writer-critic S.J. Perelman, who praised the book to anyone who would listen, and NBC newsman John Chancellor, who proudly posted "Yossarian Lives" stickers around his network's offices.

Eventually, a book that presented problems for critics defending World War II seemed ahead of its time a decade later. To some, the life of the Vietnam conflict was imitating the art of Joseph Heller. The book became something of a darkly comic bible of the anti-war generation, and the novel that never made a bestseller list when it was published has sold more than 20 million copies to date.

In 1970, Paramount Pictures released its film version of "Catch-22," with a screenplay by Buck Henry. It was directed by Mike Nichols and starred Alan Arkin as Yossarian and was a great hit.

Another measure of the book's influence is its very title. "Catch-22" has entered our language as a term for the impossibility of accomplishing a task or achieving a dream. The 1993 New Shorter Oxford English Dictionary defines Catch-22 as "a condition or consequence that precludes success, a dilemma where the victim cannot win."

A final measure of the enduring popularity of Heller and his work came in 1986, at an event marking the 25th anniversary of the book's publication. Heller, who received a standing ovation, was all but mobbed when he spoke to cadets filling a cavernous auditorium at the Air Force Academy. The author was swamped by requests for autographs and questions about his "Catch-22" characters and said he found the gathering "an intoxicating experience."

Heller based his novel on his World War II experience as a B-25 bombardier who flew 60 combat missions in the Mediterranean theater. His hero, Capt. John Yossarian, also a bombardier, was stationed with his squadron on the Mediterranean island of Pianosa. The book consists of Yossarian's quest to simply leave the war and constantly raises the issue of sanity: How sane is it to continue to fly missions in which there seems a mathematical certainty that you will be killed sooner or later?

To avoid combat, Yossarian does everything from poisoning the squadron's food to altering combat maps. His great goal is to be judged insane and thus "unfit" for combat. In addition to the fact that everyone in charge of Yossarian's Air Force seems to be insane, there is that great stumbling block, Catch-22.

Yossarian is informed of the "catch" in a conversation with Doc Daneeka, who has the power to say someone is insane and remove him from combat. The discussion involves Yossarian's friend Orr, who is crazy by any definition but continues to fly because he has not asked to be relieved.

The heart of the conversation, and the book, occurs when Yossarian asks, "You mean there's a catch?"

" 'Sure there's a catch,' Doc Daneeka replied. 'Catch-22. Anyone who wants to get out of combat duty isn't really crazy.'

"There was only one catch, and that was Catch-22, which specified that a concern for one's own safety in the face of dangers that were real and immediate was the process of a rational mind. Orr was crazy and could be grounded. All he had to do was ask; and as soon as he did, he would no longer be crazy and would have to fly more missions. Orr would be crazy to fly more missions and sane if he didn't, but if he was sane he had to fly them. If he flew them he was crazy and didn't have to; but if he didn't want to he was sane and had to. Yossarian was moved very deeply by the absolute simplicity of this clause of Catch-22 and let out a respectful whistle.

" 'That's some catch, that Catch-22,' he observed.

" 'It's the best there is,' Doc Daneeka agreed."

The book's highlights include stunning dialogue and singularly ineffectual if not evil supporting characters. There is the immensely shy and unfortunately named Major Major. There is the ever-outraged General Dreedle and the unforgettable Mad Hatter of a war profiteer, Milo Minderbinder. A mark of Minderbinder's mad genius is his convoluted and surprisingly profitable operation of buying eggs in Malta for 7 cents apiece and selling them in Pianosa for 5 cents.

The book is chock-full of such memorable throwaway observations as "I'm gonna live forever, or die trying" and "The enemy is anybody who's going to get you killed, no matter which side he's on."

Yossarian, who eventually leaves combat by trying to row a boat to neutral Sweden, reappears with many of his Army Air Forces compatriots in Heller's 1994 novel "Closing Time." The novel takes place in New York 50 years after the war with a message ultimately nearly as bleak as that of "Catch-22."

The sequel was published to generally favorable reviews and sold well upon publication. But like everything else Heller wrote, it was hardly in the same league as "Catch-22," a modern American classic.

In a way, of course, Heller's life showed that Catch-22 either did not always apply or could be overcome. Heller flew his missions, survived the war and returned to see his life transformed.

Heller was born in Brooklyn, N.Y., the son of a truck driver. He was a blacksmith's helper at the Norfolk Navy Yard in Virginia before entering the Army Air Forces in October 1942. He left the war as a lieutenant.

He was a 1948 graduate of New York University and received a master's degree in English from Columbia University in 1949 before spending a year at Oxford University as a Fulbright scholar.

He taught English at Pennsylvania State University from 1950 to 1952, then worked as an advertising manager for Time and Look magazines and as a promotion manager at McCall's magazine before returning to teaching in 1961. He then served on the faculties of Yale University, the University of Pennsylvania and, finally, the City University of New York.

Heller, who said that the work that made perhaps the earliest and longest-lasting impression on him was a prose version of the Iliad, saw his writing compared to that of J.D. Salinger, Mark Twain, Nathanael West and Franz Kafka.

His first published works were short stories in Esquire and the Atlantic magazines in 1947 and 1948. The first chapter of the novel that became "Catch-22" appeared in New World Writing magazine in 1955.

After "Catch-22," his novels included "Something Happened" (1975), "Good as Gold" (1979), "God Knows" (1984) and "Picture This" (1989). He also wrote the anti-war play "We Bombed at New Haven" in 1969. With Speed Vogel, he co-wrote the 1986 book "No Laughing Matter," which told of Heller's struggle in the early 1980s with Guillain-Barre syndrome, a neurological disorder.

He wrote screenplays for "Sex and the Single Girl" in 1964, "Casino Royale" in 1967 and "Dirty Dingus Magee" in 1970. Under the name Max Orange, Heller wrote scripts for the 1960s television series "McHale's Navy."

His marriage to the former Shirley Held ended in divorce.

Survivors include his wife, Valerie, of East Hampton.

Staff writer Martin Weil contributed to this report.

CAPTION: Joseph Heller turned his own World War II experiences into a classic.

CAPTION: Like his most famous character, Joseph Heller was a bombardier in the Army Air Forces during World War II, serving in the Mediterranean.

CAPTION: Heller smiles at the audience after reading from "Catch-22" at the Library of Congress. None of his later books achieved the same renown.