NEW YORK (AP) — Terrence McNally, one of America’s great playwrights whose prolific career included winning Tony Awards for the plays “Love! Valour! Compassion!” and “Master Class” and the musicals “Ragtime” and “Kiss of the Spider Woman,” has died of complications from the coronavirus. He was 81.

McNally died Tuesday at Sarasota Memorial Hospital in Sarasota, Florida, according to representative Matt Polk. McNally was a lung cancer survivor who lived with chronic inflammatory lung disease.

His plays and musicals explored how people connect — or fail to. With wit and thoughtfulness, he tackled the strains in families, war, and relationships and probed the spark and costs of creativity. He was an openly gay writer who wrote about homophobia, love and AIDS.

“I like to work with people who are a lot more talented and smarter than me, who make fewer mistakes than I do, and who can call me out when I do something lazy,” he told LA Stage Times in 2013. “A lot of people stop learning in life, and that’s their tragedy.”

McNally’s “Lips Together, Teeth Apart,” about two married couples who spend a weekend on Fire Island, was a landmark play about AIDS. His play “The Ritz” became one of the first plays with unapologetic gay characters to reach a mainstream audience.

McNally also explored gay themes in the book for the musical “Kiss of the Spider Woman,” for which he won his first Tony Award. His play “Love! Valour! Compassion!” earned him another Tony Award for its portrayal of eight gay men facing issues of fidelity, love and happiness.

“Theater changes hearts, that secret place where we all truly live,” he said at the 2019 Tony Awards, where he accepted a lifetime achievement award. “The world needs artists more than ever to remind us what truth and beauty and kindness really are.”

F. Murray Abraham, the Oscar-winner who appeared on Broadway in “The Ritz” said of McNally: “His plays are a pleasure to do, but what he says is important, too. And he’s like a fountain he keeps on writing and writing and writing.”

Tributes pored in online from Broadway figures, including from fellow playwrights Paula Vogel, who called McNally “the soul of kindness” and Lin-Manuel Miranda, who called McNally “a giant in our world, who straddled plays and musicals deftly.” Actor Conrad Ricamora describe McNally as “the most kind, brilliant person to work with” and talk show host James Corden tweeted: “He was an absolute gentleman and his commitment to the theater was unwavering. He will be missed by so many of us.”

Composer Tom Kitt, who won the Pulitzer Prize for Drama for “Next to Normal,” told The Associated Press he considers McNally “irreplaceable.”

“Terrence was an extraordinary man and a brilliant artist,” Kitt said. “He’s a true giant in our art form, and he will be missed and we are lucky that we had him and had his art for as long as we did.”

In 2018 McNally was inducted into the American Academy of Arts and Letters. He won four Tonys and an Emmy. New York University gave him an honorary doctorate in 2019.

Andrew D. Hamilton, president of New York University, told the crowd that day that McNally put a “unique stamp on American drama by probing the urgent need for connection that resonates at the core of human experience.”

Some of his Broadway musical adaptations include “The Full Monty,” adapted from the British film and scored by David Yazbek; “Catch Me if You Can,” based on the Steven Spielberg film, and scored by composer Marc Shaiman and lyricist Scott Wittman; and “Ragtime,” the musical based on the novel by E.L. Doctorow, which won four Tony Awards. In 2017, his musical reworking of the film “Anastasia” landed on Broadway.

His 2014 Broadway play “Mothers and Sons” — revisiting McNally’s 1990 TV movie “Andre’s Mother,” which won him an Emmy Award — explores the relationship between a mother and her dead son’

McNally was born in St. Petersburg, Florida, and grew up in Corpus Christi, Texas, listening to radio broadcasts of “The Green Hornet” and the Metropolitan Opera. He graduated Phi Beta Kappa from Columbia University in 1960 with a degree in English.

McNally was at the Actors Studio when he was hired by novelist John Steinbeck to be a tutor and guardian to his sons. One of McNally’s earliest theater attempts was writing the book for a musical adaptation of Steinbeck’s “East of Eden” which was called “Here’s Where I Belong” and lasted only a single performance on Broadway in 1968.

McNally’s first Broadway play “And Things That Go Bump in the Night” didn’t fare much better in 1965. His absurdist, symbolic melodrama about good and evil confounded critics. Newsday called it “ugly, perverted, tasteless.” It closed in less than three weeks. He was 24.

He rebounded with the 1969 off-Broadway hit “Next,” a two-character comedy about a reluctant draftee reporting for an Army physical. A string of successes followed, including “Where Has Tommy Flowers Gone?” (1971), “The Tubs” (1974), “Bad Habits” (1974) and “The Ritz” (1975), a farce set in a gay bathhouse that ran more than a year on Broadway and became McNally’s first produced screenplay.

His breakout, “Frankie and Johnny in the Clair de Lune,” about a romance between a waitress and short order cook, was later adapted into a film starring Al Pacino and Michelle Pfeiffer. It was revived on Broadway in 2019 starring Audra McDonald.

He collaborated three times with legendary composer John Kander and lyricist Freb Ebb — on “The Rink,” “Kiss of the Spider Woman” and “The Visit.” Chita Rivera starred in all three.

His love of opera informed his works “Golden Age,” “The Lisbon Traviata” and “Master Class,” which explored the life of opera diva Maria Callas. He also contributed to opera as a librettist — “The Food of Love” in 1999 with music by Robert Beaser, “Dead Man Walking” in 2000 with music by Jake Heggie, and 2015’s “Great Scott” with Heggie.

McNally sometimes was controversial, especially with his play “Corpus Christi,” which depicts a modern-day Jesus as a homosexual. The Manhattan Theater Club, the first company to consider staging it, received death threats and temporarily canceled the production before enjoying a successful run.

When picking up his “Ragtime” Tony Award, McNally thanked the theater community for its outcry. “You came together when I was in trouble. It was a time of oppression. You came together overnight. Our voices were heard, and we won.” Holding his Tony high, he said, “So this is for freedom. Thank you.”

McNally and his partner, Thomas Kirdahy, married in Vermont in 2003, and again in Washington, D.C., in 2010.