Scarlett Johansson is leaving the movie "Rub & Tug" after her casting as a transgender man sparkled backlash from trans groups.

"In light of recent ethical questions raised surrounding my casting as Dante Tex Gill, I have decided to respectfully withdraw my participation in the project," the actress said in a statement to Out.com.

"Rub & Tug" is based on the true story of Jean Marie Gill, who was assigned female at birth but assumed the identity of a man, Dante “Tex” Gill, and operated a massage parlor and prostitution business in Pittsburgh in the '70s and '80s.

The project was announced July 2 with director Rupert Sanders attached. Sanders worked with Johansson on "Ghost in the Shell."

But the actress playing a trans man was met with sharp criticism on social media. And a statement from her rep didn't help quell the rage: "Tell them that they can be directed to Jeffrey Tambor, Jared Leto, and Felicity Huffman’s reps for comment.”

Here is the full text of Johansson's statement:

In light of recent ethical questions raised surrounding my casting as Dante Tex Gill, I have decided to respectfully withdraw my participation in the project.

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. I have great admiration and love for the trans community and am grateful that the conversation regarding inclusivity in Hollywood continues. According to GLAAD, LGBTQ+ characters dropped 40% in 2017 from the previous year, with no representation of trans characters in any major studio release.

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. I believe that all artists should be considered equally and fairly.

My production company, These Pictures, actively pursues projects that both entertain and push boundaries. We look forward to working with every community to bring these most poignant and important stories to audiences worldwide."