She went on to earn another Tony nomination in the Lincoln Center Theater’s 1996 revival of “A Delicate Balance,” Edward Albee’s ferocious dark comedy about an upper-class household in distress. She played the witty, bellicose houseguest of her sister (Rosemary Harris) and brother-in-law (George Grizzard).

When “Elaine Stritch at Liberty” was broadcast on HBO in 2004, Ms. Stritch added an Emmy to her collection of awards, but that was far from her final triumph. She also created a series of solo cabaret shows for Café Carlyle, including one that was a tribute to Sondheim.

“The blazingly here-and-now Ms. Stritch gives the word ‘trouper,’ a term of respect for stars who have trod the boards for decades, an almost mythological dimension,” Stephen Holden of The Times wrote in a review.

In May 2008, in a surprising change of pace, she appeared in a production of “Endgame,” Samuel Beckett’s grim comedy about mortality, at the Brooklyn Academy of Music. As inhabitants of a bleak netherworld, she and her onstage husband (Alvin Epstein) lived in oversize garbage cans.

Ms. Stritch performed at the Paper Mill Playhouse in Millburn, N.J., in June 2009 in a production of “The Full Monty,” based on the 1997 British film comedy about a group of unemployed steelworkers who decide to perform as male strippers. Ms. Stritch, who played the group’s rehearsal pianist, said in an interview that she was “happy to be doing something that wasn’t all about me.”

She made her final Broadway appearance in 2010, replacing Angela Lansbury as the aging Madame Armfeldt in a Broadway revival of “A Little Night Music.” It was a role that allowed her to sing once more of Mr. Sondheim’s rueful, mortality-defying musical meditations, “Liaisons,” an aching paean to love affairs past, and she brought to it an original and rather stinging bitterness about a life that is nearly over.

In “At Liberty,” Ms. Stritch earned one of her biggest laughs with a story about a long night of drinking with a friend. The story was ostensibly about the friend — Judy Garland — but it was self-reflective, too. Along about breakfast time, Ms. Stritch recalled, Garland turned to her.

“Elaine, I never thought I’d say this,” Garland said, “but good night.”