"Gods of Egypt" director Alex Proyas and Lionsgate, the studio behind the action-fantasy film, have apologized after the film's lack of diversity sparked backlash.

The film drew criticism for casting predominantly white actors like Gerard Butler, Geoffrey Rush, Brenton Thwaites and Nikolaj Coster-Waldau in the fantasy epic, which is set in ancient Egypt, according to The Guardian.

Actress and singer Bette Midler was among those who slammed the film over its lack of diverse characters.

"Movie, #GodsOfEgypt in which everyone is white? Egyptians, in history and today, have NEVER been white. BRING BACK GEOGRAPHY!! It's Africa!" she tweeted earlier this month.

Proyas and Lionsgate responded to the casting controversy by issuing a formal apology. "The process of casting a movie has many complicated variables, but it is clear that our casting choices should have been more diverse," said Proyas, according to The Hollywood Reporter. "I sincerely apologize to those who are offended by the decisions we made."

"We recognize that it is our responsibility to help ensure that casting decisions reflect the diversity and culture of the time periods portrayed. In this instance we failed to live up to our own standards of sensitivity and diversity, for which we sincerely apologize," the studio said.

"Lionsgate is deeply committed to making films that reflect the diversity of our audiences. We have, can and will continue to do better," the company added.

"Gods of Egypt" isn't the only film that came under fire for casting white actors in roles that require more diverse selections. Last year's Ridley Scott film "Exodus: Gods and Kings" also faced criticism for whitewashing its cast. More recently, the Peter Pan film "Pan" faced backlash after Rooney Mara was cast in the film to play the role of a Native American, Tiger Lily, according to TheWrap.

"Gods of Egypt" is slated to hit theaters on Feb. 26, 2016.

Watch the trailer below: