Scarlett Johansson said in an interview published Tuesday that she "mishandled" her response to backlash she received in 2018 for agreeing to portray a transgender man in the film "Rub and Tug."

The actress quit the film — based on the real-life story of Dante "Text" Gill, who operated a string of massage parlors that were fronts for prostitution dens in the 1970s and '80s — after critics said her casting took opportunities from members of marginalized communities, namely transgender actors.

She initially defended her casting in a rebuttal to those critics. Bustle published a statement from one of her representatives in early July 2018 that said: “Tell them that they can be directed to Jeffrey Tambor, Jared Leto, and Felicity Huffman’s reps for comment.”

Tambor, Leto and Huffman, who are cisgender, have played transgender characters. Tambor won multiple awards for his work in the Amazon series "Transparent," Huffman was nominated for an Oscar for her role in the 2005 film "Transamerica" and Leto won an Oscar for his performance in "Dallas Buyers Club" in 2013.

Shortly after the outcry over her casting and the response from her representative, Johansson withdrew from the film.

"While I would have loved the opportunity to bring Dante's story and transition to life, I understand why many feel he should be portrayed by a transgender person," Johansson told Out magazine in July 2018.

In an interview with Vanity Fair published online Tuesday, Johansson said her response was insensitive.

“In hindsight, I mishandled that situation. I was not sensitive, my initial reaction to it," she said. "I wasn’t totally aware of how the trans community felt about those three actors playing — and how they felt in general about cis actors playing — transgender people."

"I wasn’t aware of that conversation — I was uneducated," she continued. "So I learned a lot through that process. I misjudged that... It was a hard time. It was like a whirlwind. I felt terribly about it. To feel like you’re kind of tone-deaf to something is not a good feeling.”

Johansson previously faced accusations of whitewashing for her role in the 2017 live-action American film adaptation of the Japanese manga series "Ghost In The Shell."