(CNN) Scarlett Johansson has opted to withdraw from a film in which she was set to play a transgender man after her casting drew criticism from the LGBTQ community.

Johansson said an exclusive statement to Out.com that her decision was made "in light of recent ethical questions raised surrounding my casting."

CNN has reached out to Johansson's representatives for further comment.

Johansson had been set to play transgender man Dante "Tex" Gill, who owned a string of massage parlors in Pittsburgh that were fronts for prostitution in the 1970s and 1980s, in a film about his life.

Johansson's casting, however, came at a moment when the LGBTQ community and allies are encouraging the casting transgender actors in transgender roles.

Read More