Today, the casting would be the subject of blog posts, tweet storms and op-eds. But 35 years ago, when Peter Weir embraced the spirit of the title “The Year of Living Dangerously” and hired an American woman to play a Chinese-Australian man in that political drama, his gamble paid off: Linda Hunt became the only person to win an Academy Award for playing a cisgender character of the opposite sex.

It wasn’t an easy decision. The filmmaker had asked a fellow Australian, David Atkins, to take the role of the dwarf Billy Kwan in the drama about expats in Indonesia during the 1965 coup attempt. But Atkins didn’t click with the movie’s star, Mel Gibson, during rehearsals. “Sets were being constructed in Manila, and the clock was ticking,” Weir recalled in a recent email. “The casting agent said he had a possible Billy Kwan called L. Hunt. He then revealed he was a she. We were desperate and gave her a try, and she was great.”

But Hunt, a stage actress whose sole film credit was a part in Robert Altman’s “Popeye,” wasn’t sure she could pull off the role of a male photographer who facilitates a romance between an Australian journalist (Gibson) and a British diplomat (Sigourney Weaver). “She said, ‘Could you rewrite it for a woman?’” Weir remembered. “I said it would change the whole story. Silence. ‘Could you play a man?’ Now a really long silence. ‘Only if you believe in me,’ she said. So we took the plunge.”

During the early stages of production, Hunt still doubted herself. “I thought, oh my God, I’m going to have to go somewhere when this film opens, just away, as far as I could get,” she told The Daily Beast in 2011. She said she thought her performance “was so awful. It got better and better as we went on.” Hunt declined to be interviewed for this article.

That she has been. Hunt has gone on to play memorable parts in “Silverado,” “Stranger Than Fiction” and other movies, and has co-starred on “NCIS: Los Angeles” since 2009.

Nontraditional gender roles have attracted the attention of Oscar voters over the years, with Jack Lemmon earning a best actor nomination for the cross-dressing comedy “Some Like It Hot” and William Hurt taking home the same award for his gay prisoner who identifies as a woman in “Kiss of the Spider Woman.” More recently, playing transgender characters has won Oscars for Hilary Swank in “Boys Don’t Cry” and Jared Leto in “Dallas Buyers Club.” Cate Blanchett received a nomination for her turn as Bob Dylan in “I’m Not There,” but Hunt’s win remains the only time the academy has honored a woman for playing a cisgender man.

As the Turner Classic Movies host Dave Karger said in a recent phone interview, “It seemed crazy, but it totally worked, and that’s why she won.”

In the wake of the whitewashing charges that have been leveled against the casting of white actors like Emma Stone (“Aloha”) as characters of Asian heritage, Hunt might prove an even more controversial choice today as the half-Asian Kwan. (Advocates for little people might also object.) But Weir indicated he would do it again: “Casting is critical and should not be influenced by any fashionable trends.”

Hunt’s work remains audacious more than three decades later. In a recent phone interview, Pete Hammond, a film critic and awards columnist for Deadline, called it “a dominating performance. She totally immersed herself in that character. It was impossible to ignore.”

The academy didn’t, and Weir could not have been more pleased. “I was thrilled to see her win the award for this extraordinary gamble,” he said. “So well-deserved.”