Avengers: Endgame” actress Scarlett Johansson admitted that she “mishandled” the backlash she received in 2018 for agreeing to take on the role of a transgender man.

Johansson quit the film “Rub and Tug” after critics bashed the actress for taking on the role of Dante “Tex” Gill--a transgender man who made a name for himself by using massage parlors as fronts for prostitution--as well as her reaction to the criticism.

“In hindsight, I mishandled that situation. I was not sensitive, my initial reaction to it. 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,” she admitted in a recent interview with Vanity Fair. “I wasn’t aware of that conversation—I was uneducated.”

SCARLETT JOHANSSON ON POLITICALLY CORRECT CASTING: 'I SHOULD BE ALLOWED TO PLAY ANY PERSON'

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.”

Prior to dropping out of the film, the actress released a statement obtained by Bustle, via a rep, which read: “Tell them that they can be directed to Jeffrey Tambor, Jared Leto, and Felicity Huffman's reps for comment.”

US actress Scarlett Johansson arrives for the World premiere of Marvel Studios'

Scarlett Johansson revealed that she believes she 'mishandled' her previous casting scandal. (Getty)

All of those actors had recently been awarded for roles where they played transgender people.

The star’s recent comments echo those she made to Out Magazine shortly after withdrawing from the role in July 2018.

"Our cultural understanding of transgender people continues to advance, and I’ve learned a lot from the community since making my first statement about my casting and realize it was insensitive," Johansson told the outlet.

SCARLETT JOHANSSON CLARIFIES COMMENTS ABOUT POLITICALLY CORRECT CASTING

"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, and I am thankful that this casting debate, albeit controversial, has sparked a larger conversation about diversity and representation in film," Johansson continued. "I believe that all artists should be considered equally and fairly."

Scarlett Johansson commented on her past casting backlash. (AP)

In 2015, Johansson was accused of "white-washing" for her role as an Asian woman in the film "Ghost In The Shell." The film, based off a Japanese manga character, sparked a petition to recast her in the role.

Johansson addressed the backlash in a 2017 interview with Maire Claire, saying she “certainly would never presume to play another race of a person.”

CLICK HERE TO GET THE FOX NEWS APP

“Diversity is important in Hollywood, and I would never want to feel like I was playing a character that was offensive,” she said before defending her decision to star in the film. “Also, having a franchise with a female protagonist driving it is such a rare opportunity. Certainly, I feel the enormous pressure of that — the weight of such a big property on my shoulders.”