LOS ANGELES — “The Graduate” co-writer Buck Henry, who as screenwriter, character actor, “Saturday Night Live” host and cherished talk-show and party guest became an all-around cultural superstar of the 1960s and ’70s, has died. He was 89.

Henry’s wife, Irene Ramp, told The Washington Post that his death Wednesday in Los Angeles was due to a heart attack.

Henry, who also co-created the TV spy spoof “Get Smart” with Mel Brooks and others, managed to pull off the rare Hollywood coup of screenwriter-as-celebrity, partly through inserting himself in his films in small-but-memorable roles.

In “The Graduate,” Mike Nichols’ classic 1967 film that made a star of Dustin Hoffman, Henry and Calder Willingham adapted the script from the Charles Webb novel about a young man who has an affair with one of his parents’ friends. Henry created a role for himself as the room clerk at the hotel who spooks a young Dustin Hoffman with the unintended double entendre, “Are you here for an affair, sir?”

“What?” Benjamin says, nervously. “The Singleman party, sir?” Henry responds.

His script would get Henry the first of his two Academy Award nominations.

Henry also wrote Nichols’ follow-up film “Catch-22,” the Barbra Streisand comedies “The Owl and the Pussycat” and “What’s Up, Doc” and director Gus Van Sant’s 1995 film “To Die For,” starring Nicole Kidman and Joaquin Phoenix.

“Loved your scripts for Owl and the Pussycat, What’s up, Doc? and so many others. Rest in peace,” Streisand said on Twitter after Henry’s death.

Short and deceptively mild, wearing black-rimmed glasses, Henry was already an established film and television writer who became widely recognizable during the early years of “Saturday Night Live.” He hosted numerous times and often appeared with John Belushi’s Samurai character, as the straight man reacting to the hot-tempered swordsman speaking in mock Japanese.

On one segment, “Samurai Stockbroker,” Belushi swung his sword and accidentally sliced Henry in the face. “You wouldn’t believe how much blood from a forehead was on that floor,” Henry recalled in the book “Live From New York.”

He pressed on with the live show, a clamp on his head, and sympathetic cast members begin feigning their own injuries. “By the end of the show,” Henry said, “when the camera pulls back, you see some of the crew are on crutches, others have bandages or their arms in slings. As if the whole show caught a virus. It was pretty funny.”

His other “SNL” characters included the creepy baby-sitter Uncle Roy and the father of Bill Murray’s nerd Todd. His gift for satire and knowledge of current events fit perfectly with the brash outlook of the young cast and writers.

“Buck played a unique role among those early hosts,” Al Franken, the former U.S. senator who was a writer on “Saturday Night Live” in its early years, said on his website Thursday. “When Buck hosted, the week was somehow different. He was just around, effortlessly teaching us the right attitude to write and play comedy. There was never any reason to panic and every reason to remain open to each other’s talent and inspired silliness.”

Franken called Henry ”one of the truly great comedic minds of his generation,”

He was one of many prominent names who heaped Henry with praise as word of his death spread.

“Buck Henry was hilarious and brilliant and made us laugh more times than we even know,” writer-director Judd Apatow said on Instagram.

Actor Michael McKean called Henry a “brilliant talent and a really lovely guy.”

For decades after “The Graduate,” Henry was pestered by people asking him if there would be a sequel. He tried to stop the talk by improvising a scene in Robert Altman’s 1992 Hollywood satire, “The Player,” in which he portrays himself trying to pitch “The Graduate, Part II,” a story “dark and weird and funny,” even though Mrs. Robinson has had a stroke.

With Warren Beatty, Henry co-directed and appeared in 1978’s “Heaven Can Wait,” the hit remake of a Hollywood classic about a man who dies by mistake and is sent back to earth in someone else’s body.

The film got nine Oscar nominations, including one for Henry and Beatty as best directors. It was a rare film directing credit for Henry, who mostly directed episodes of the television shows he wrote for.

Henry’s output began to decrease after the 1970s, although he continued to make TV and film appearances. Among his later credits were appearances on the TV shows “Will & Grace,” and “Murphy Brown” and in the films “Rude Awakening” and “Breakfast of Champions.”

Born in New York on Dec. 9, 1930, Buck Henry Zuckerman was the son of actress Ruth Taylor, a Mack Sennett performer who starred in the silent film version of “Gentlemen Prefer Blondes.” His father, Paul Zuckerman, was a stockbroker and retired Air Force general. Henry divided his boyhood between Hollywood and New York, listening to the sophisticated chatter of his mother’s friends and co-workers.

”I saw how silly and funny and trivial these stars could be,” he said in a 1997 interview. “But I also remember thinking, `Gee, this would be a good way to live.’ These people are not responsible for anything except their own talents and their own vices.”

Henry first attracted notice in the 1950s when he and a friend launched the Society for Indecency to Naked Animals, a spoof of Puritanism. Many people took the joke seriously, however, and Henry gave deadpan TV interviews about the group. He also took part in such stunts as trying to fit boxer shorts on a baby elephant at the San Francisco Zoo. His success from that venture was short-lived, however, and after six years of what he termed “vigorous, total unemployment, characterized by a great deal of sleep,” Henry gave up seeking jobs as an actor. Instead, he began selling gags to TV shows hosted by the likes of Steve Allen, Garry Moore and others.

His breakthrough came when he and Mel Brooks wrote the TV pilot for “Get Smart.” A takeoff on the James Bond movies, it starred Don Adams as bumbling secret agent Maxwell Smart and Barbara Feldon as his beautiful and smarter sidekick, Agent 99. It aired from 1965 to 1970 and made catchphrases of “Would you believe... ?” and “Sorry ’bout that, chief.”

Henry and Brooks would soon become estranged over how their names appeared in the credits — “Created by Mel Brooks with Buck Henry.” Henry believed he deserved equal billing.