Chavela Vargas, who defied gender stereotypes to become one of the most legendary singers in Mexico, died Sunday at a hospital in the city of Cuernavaca, where she had been admitted for heart and respiratory problems. She was 93.

Vargas rose to fame flouting the Catholic country’s preconceptions of what it meant to be a female singer: singing lusty “ranchera” songs while wearing men’s clothes, carrying a pistol, drinking heavily and smoking cigars. Though she refused to change the pronouns in love songs about women as some audiences expected, many of her versions of passionate Mexican folk songs are considered definitive.

Born in San Joaquin de Flores, Costa Rica, Vargas immigrated to Mexico at age 14. She sang in the streets as a teenager, then ventured into a professional singing career well in her 30s.

Vargas recorded 80 albums throughout her career, becoming a major figure in Mexico City’s artistic explosion of the mid-20th century. She was a friend and a frequent house guest of the Mexican painters Frida Kahlo and Diego Rivera and was close to the Spanish writer Federico Garcia Lorca.

Vargas appeared in the 2002 film “Frida,” about her old friend, singing the eerie song “La Llorona,” or “The Crier,” in a hoarse but haunting voice.

“I don’t think there is a stage big enough in this world for Chavela,” wrote the Spanish director Pedro Almodovar, who featured her music in many of his films.

Though her liaisons with women were known throughout her life, Vargas did not publicly come out as a lesbian until publishing her autobiography “Y si quieres saber de mi pasado” — “If You Want to Know About My Past” — at the age of 81.

In 2011 Vargas was still at work, releasing a new album of Garcia Lorca’s poems and basking in standing ovations from a wheelchair on stage while wearing her emblematic neckerchief.

In 2007 the Latin Recording Academy gave her its lifetime achievement award.