LOS ANGELES — Landmark Chilean drama "A Fantastic Woman," a stirring story of love and loss that centers on a transgender woman, won the Oscar for best foreign language film on Sunday.

"I'm in Jupiter," elated director Sebastian Lelio said backstage after accepting his golden statuette. "I can't believe this happened."

A favorite to win, the film has been hailed as a milestone in representing transgender characters and for taking on the timely subject of transgender identity with compassion and sensitivity.

Lelio said he hoped the film's Academy Award recognition would help "contribute to a necessary and urgent conversation" about transgender rights in Chile and around the world.

"A Fantastic Woman" follows Marina, a transgender waitress and nightclub singer, whose long-term and loving older boyfriend suddenly dies. They had shared a protective bubble of bliss and tenderness that is suddenly shattered and Marina's world falls apart.

Marina, played by transgender actress Daniela Vega, spends most of the film numbed by grief and battling for the right to mourn as her lover's family shuns and humiliates her and tries to block her from his funeral.

When Lelio accepted the award on stage, he called Vega his inspiration for the film. Vega joined the director and producers on stage and later took to the stage alone to present one of the evening's musical performances. "Thank you so much for this moment," Vega said, wearing a strapless magenta gown.

Some had hoped Vega would become the first transgender actor nominated for an Oscar. Hollywood has come under increasing criticism for celebrating trans stories played by non-trans actors, while failing to cast transgender actors — Hilary Swank ("Boys Don't Cry"), Jared Leto ("Dallas Buyers Club"), Eddie Redmayne ("The Danish Girl") and Felicity Huffman ("Transamerica") have all garnered Oscar nominations for trans roles, with Swank and Leto winning.

Lelio said it was important to him to cast the part of Marina with a transgender actress. He initially started working with Vega as a consultant for the film but in the process of honing the script together, Lelio realized his adviser was his star.

"I was not going to make this film without a transgender actress in the main role," Lelio said backstage, adding that Vega brought a presence and truthfulness and complexity to the role that he didn't think a non-transgender actor could have.

Vega transitioned 14 years ago in Chile and was "a pioneer," Lelio said.

"She carries that history and the camera knows that," he said.

The Chilean film beat out Lebanon's "The Insult," Russia's "Loveless," Hungary's "On Body and Soul," and Sweden's "The Square."

The category was presented by Puerto Rican actress-singer Rita Moreno, who donned the same gown she wore 56 years ago when she won best supporting actress for "West Side Story" in 1962

Moreno received a standing ovation when she took the stage.

The 86-year-old Moreno quoted Frank Capra as saying there were three universal languages: "Music, mathematics and the one we honor tonight, the universal language of film," Moreno said.

"Regardless of its country of origin or the dialect of its words, a great film conveys a story that speaks to the one condition we all share," Moreno said. "The human condition."