Chavela Vargas, a preeminent interpreter of the music of loss and longing known as ranchera, who defiantly shattered gender stereotypes and blazed a legendary path through 20th-century Mexican popular culture, died Aug. 5 at a hospital in Cuernavaca, Mexico. She was 93.

She had multiple organ failure, according to a hospital spokeswoman. Ms. Vargas had been hospitalized for several days after her return from Spain, where she had been promoting a CD dedicated to Spanish poet Federico Garcia Lorca.

Ms. Vargas experienced her first flush of fame in the mid-20th century and cultivated an outlaw image by wearing men’s clothing, packing a pistol and knocking back copious quantities of tequila. She enjoyed a second, perhaps even greater round of admiration beginning in the 1990s, with a rediscovery fueled largely by Spanish filmmaker Pedro Almodovar, who championed her music for a new generation and included it in some of his movies.

Almodovar described Ms. Vargas’s chosen instrument as “la voz aspera de la ternura” — the rough voice of tenderness.

Isabel Vargas Lizano was born April 17, 1919, in San Joaquin de Flores, Costa Rica, and had hoped to be a musician from an early age. In the 1930s, after her parents divorced and after a childhood she described as unhappy, she relocated to Mexico, where she took a number of odd jobs and eventually dedicated herself to singing.

By the 1950s, she had become a fixture in Mexico City’s thriving bohemian club scene, where she became a standout for her androgynous style and overt references to her homosexuality — which she would not make public until 2000 — but also for her undeniable talent for finding the soulful pith in the rancheras, boleros and corridos of the day.

Often accompanied by stark, minimal guitars, Ms. Vargas expertly shifted her voice between jarringly different moods, often within a single song — from intimately confessional to brightly hopeful to searingly wounded. The late Mexican essayist Carlos Monsivais wrote that Ms. Vargas knew “how to express the desolation of the rancheras with the radical nakedness of the blues.”

Along the way, she mingled with the cream of Mexico’s artistic and intellectual set, including writer Juan Rulfo, composer Agustin Lara, and the painters Diego Rivera and Frida Kahlo.

It was long rumored that the bisexual Kahlo and Ms. Vargas engaged in a romantic affair. In 2009, the Los Angeles Times reported that a diary purportedly belonging to Kahlo described the painter’s intense — but unrequited — attraction to the singer.

Ms. Vargas recorded her first record, “Noche de Bohemia,” in 1961 and went on to record more than 80 others. Her versions of songs such as“La Llorona” (The Weeping Woman) and “Piensa en Mi” (Think of Me) are considered definitive.

By 1976, a life lived as hard as she had described in her songs had caught up with her, and she largely disappeared from public life until the 1990s, when she was rediscovered by a new generation of fans. In 2002, she appeared in the biographical Kahlo film “Frida,” in which she sang “La Llorona.” In 2007, she was awarded a Latin Grammy for a career of musical excellence.

Ms. Vargas’s late-in-life coming out was not much of a surprise to anyone who had followed her career. She often declined to change the pronouns in love songs written by men from “she” to “he.” But she also tended to shun modern gender pigeonholes, noting that many described her as “rareza” — a rarity.

In recent years, a number of younger artists acknowledged their debt to Ms. Vargas’s style. They included Spanish singer Concha Buika, who won a Latin Grammy for best traditional tropical album with her tribute to Ms. Vargas, “El Ultimo Trago” (The Last Drink).

In a 2010 interview with the Miami Herald, Buika said that Ms. Vargas taught her to “make a monument out of loneliness.”

“This is what I learned from Chavela,” she told the paper, “that loneliness is the best and most liberating of companions.”

— Los Angeles Times