Terrence McNally, the playwright behind “Master Class” and “Frankie and Johnny in the Clair de Lune,” has died of complications from coronavirus. He was 81.

The four-time Tony Award winner was a lung cancer survivor who lived with chronic COPD. He died on Tuesday at the Sarasota Memorial Hospital in Florida.

McNally’s resume was notable for its range, barrier-breaking depictions of gay life, and interest in subjects such as middle-aged romance and opera considered taboo by the commercial theater. His career moved from farces like “The Ritz” to thought-provoking, award-winning dramas such as “Love! Valor! Compassion!” and “Master Class.” McNally is one of the first major celebrities to die from coronavirus complications. Broadway and New York theaters have been closed for more than a week due to the pandemic — it’s a public health crisis that threatens the institutions where McNally lived, worked, and received great acclaim.

Though his debut on Broadway, “And Things That Go Bump in the Night,” was universally panned, McNally buckled down and slowly developed his reputation through successful one-act productions, eventually triumphing on Broadway and winning four Tonys, two for dramatic works “Love! Valour! Compassion!” and “Master Class,” and two for the musical books of “Kiss of the Spider Woman” and “Ragtime.”

McNally developed a home at the Manhattan Theater Club, where many of his Broadway productions were developed and refined. And while musical productions “Kiss” and “Ragtime” were bigger hits than any of his plays, he was nonetheless one of the few consistent dramatic voices on a Broadway otherwise dominated by lavish musicals and stage versions of hit movies. He was clearly devoted to the theater and worried about the fate of drama on the commercial stage, authoring numerous articles in which he discussed his fears.

After his initial (and rather spectacular) failure, his one act “Next” was a solid Off Broadway hit, and he developed a reputation as a writer of stinging dialogue, so much so that it took a number of dramatic hits to dislodge this narrow assessment from the minds of critics and audiences. His later plays eventually overshadowed his more audacious farcical pieces and demonstrated his ability to mine both humor and heartbreak from material.

His love of theater, McNally had said, was imbued by his New York emigre parents while he was growing up in Corpus Christi, Texas (he was born in St. Petersburg, Fla.). It was also in Corpus Christi that he first heard an opera broadcast from Mexico of singer Maria Callas, who would figure prominently in two of his later dramas, “Lisbon Traviata” and “Master Class.” He started writing plays in high school, one of which he frequently joked about: a musing on George Gershwin, who at the end of the piece married his sweetheart Ira — until an English teacher pointed out that Ira was George’s brother.

After receiving a B.A. in journalism from Columbia University and flirting briefly with work as a reporter, McNally settled in New York. An early relationship with Edward Albee would follow him around for many years afterward: Some sneeringly referred to McNally as “the boyfriend” when “Bump” debuted on Broadway, even though by then he had lost contact with Albee.

McNally’s first produced play was “This Side of the Door,” staged Off Broadway in 1963. He was already part of a generation of new playwrights including Leonard Melfi, Israel Horovitz, Arthur Kopit and Sam Shepard when “And Things That Go Bump in the Night,” his first three-act play, debuted on Broadway in 1965 to scathing reviews. It ran for only two weeks and sent him scurrying back to journalism; he spent a year working on Columbia’s alumni magazine. He then participated in another flop, “Here’s Where I Belong,” a musical version of “East of Eden” for which he wrote the book.

To sharpen his dramatic instincts, McNally devoted himself to turning out a series of one-act plays. “Apple Pie” was the umbrella title of three one-acts for National Education Television; “Botticelli” was also written for NET. His “Noon” became the centerpiece of a Broadway triplet, “Morning, Noon and Night,” while “Tour” was produced Off Broadway as part of an evening called “Collision Course.”

But it was “Next,” directed by Elaine May, that turned his career around. Starring James Coco, the tale of a middle-aged man mistakenly drafted into the Army veered wildly from farce to tragedy. It was widely praised when paired with May’s “Adaptation” in a 1967 Off-Broadway production. “Sweet Eros,” produced the following year, was extremely controversial, though not because of its storyline: A kidnapper relates his tale to his prey. But the kidnapping victim (who doesn’t speak a word during the play) was completely naked (Oscar-nominee Sally Kirkland originated the role). Other one-acts, such as “Cuba Si!,” “Whiskey,” “Witness,” “Bringing It All Back Home” and “Last Gasps,” some replete with stinging social commentary, also added to his stature as a playwright to watch.

His next full-length drama, “Where Has Tommy Flowers Gone?,” in 1971, was not a major success, but an Obie came his way in 1974 for “Bad Habits,” a pair of one-acts (“Dunelawn” and “Ravenswood”) set in an insane asylum.

McNally revised his 1974 play “The Tubs” for Broadway, where it opened as “The Ritz” — a frenetic farce set in a pre-AIDS gay bathhouse that was a big hit and won Rita Moreno a Tony Award for her performance. It was later adapted into a 1976 movie by Richard Lester of “A Hard Day’s Night” fame, one of the first major studio releases to depict gay life candidly on screen. However, reviews were mixed and the film flopped.

There was another serious setback, “Broadway, Broadway,” which closed out of town in 1978 and sent McNally into a tailspin. “I didn’t do any writing for four or five years,” he confessed at the time. He actually wrote some television, including an adaptation of John Cheever’s “The Five Forty-Eight” and the short-lived 1984 sitcom “Mama Malone.”

But he slowly returned to the theater, revising the story of a disastrous opening night into “It’s Only a Play,” which was performed in 1982 at Manhattan Punchline and then, more successfully, by Manhattan Theater Club in 1986.

That began a fruitful relationship with the Off Broadway company that saw several successive hits including “Frankie & Johnny in the Clair de Lune” in 1987. The story of an overweight waitress and her short-order cook beau and the insecurities that almost tear them apart showed a new maturity for McNally in a work that balanced comedy and drama. It was the first show he wrote after becoming sober.

“There was certainly a change in my work,” McNally told the New York Times in 2019. “It’s hard to know who you are if you’re drunk all the time. It clouds your thinking. I started thinking more about my people — my characters.”

“Frankie & Johnny” later became a 1991 movie, though a not very good one, raising eyebrows with the casting of Michelle Pfeiffer and Al Pacino in roles originated by Kathy Bates and F. Murray Abraham. The show has been revived twice on Broadway, with the likes of Edie Falco and Stanley Tucci in 2002, and Audra McDonald and Michael Shannon in 2019.

In 1984 he wrote a harrowing dramatic book for the short-lived musical “The Rink,” about a tempest-tossed relationship between a mother and daughter (played by Liza Minnelli and Chita Rivera).

He also revived another earlier play, 1985’s “Lisbon Traviata,” which was successfully produced by Manhattan Theater Club in 1989. The tale of two gay Callas devotees, half-comedic and half-tragic, never completely meshed, but “Traviata” was a breakthrough for McNally, demonstrating strengths that earlier plays had only hinted at. During this period he also wrote another one-act, “Hope,” and “Prelude and Liebestod,” as well as the delightfully silly screenplay to “Earth Girls Are Easy” (1989) and the AIDS drama “Andre’s Mother,” which aired on PBS’ “American Playhouse” and earned him an Emmy.

AIDS figured as a backdrop in “Lips Together, Teeth Apart” in 1991. The tale of two married couples, originally performed at the Manhattan Theater Club, was McNally’s most seamless and affecting blend of comedy and drama. His next play, “A Perfect Ganesh,” was widely praised. It was a fully realized drama with humorous elements about two older women on a trip to India that becomes a spiritual quest.

Also in 1993, McNally wrote the book to the musical “Kiss of the Spider Woman,” based on Manuel Puig’s novel about two men who form an unlikely bond in a South American prison. It became a major Broadway hit and earned him a Tony. In 1997 McNally would have an even bigger musical theater success when he adapted E.L. Doctorow’s “Ragtime,” a sprawling look at early 20th century America, to the stage.

At the same time, his skill as a dramatist was at its peak. “Love! Valour! Compassion!,” his most unabashed drama about gay life in the AIDS era, earned him his first Tony as a dramatic writer in 1994. It was made into a film in 1997 with almost the entire Broadway cast making the transition to the big screen with the notable exception of Nathan Lane who was replaced by Jason Alexander.

He drew another Tony for “Master Class,” a tour de force for actress Zoe Caldwell, who played Maria Callas as she teaches aspiring opera singers and re-examines her own tempestuous life. A planned film adaptation with Faye Dunaway never materialized.

McNally generated controversy — even drawing death threats — for his passion play “Corpus Christi,” in which Jesus and the Apostles were recast as gay men in Texas. The playwright appeared in a 2011 documentary about the work and its reception, “Corpus Christi: Playing With Redemption.”

Working regularly in musicals, he adapted the successful Fox Searchlight film “The Full Monty” for the stage, penning the Tony-nominated book for a show that ran for 770 performances from 2000-02. McNally also wrote the musical bio-revue “Chita Rivera: The Dancer’s Life,” starring Rivera and based on her life, which ran on the Rialto in 2005-06. He also penned the book for Kander and Ebb musical “The Visit,” first produced in 2001. It hit Broadway in 2015 with Rivera starring.

For TV, McNally penned one of three segments in 2000 Showtime telepic “Common Ground,” about homosexuals seeking respect from the majority.

McNally received a Lucille Lortel Award for an outstanding body of work in 1992. He was also the recipient of two Guggenheim Fellowships and a Rockefeller Grant.

The longtime member of the Council of the Dramatists Guild served as vice president of the body from 1981 to 2001.

He is survived by husband Thomas Kirdahy, whom he wed in 2010 after a long relationship. Other survivors include brother Peter McNally and his wife Vicky McNally, their son Stephen McNally and his wife Carmen McNally and their daughter Kylie McNally; mother-in-law Joan Kirdahy, sister/brother-in-laws Carol Kirdahy, Kevin Kirdahy and his wife Patricia, James Kirdahy and his wife Nora, Kathleen Kirdahy Kay, Neil Kirdahy and his wife Sue.