(CNN) The makers of the forthcoming film "Gods of Egypt" apologized for showcasing a predominantly white cast amid criticism over lack of diversity in a film based on Egyptian mythology.

The fantasy epic, slated for release in February, stars Scotsman Gerard Butler of "300" fame and Danish actor Nikolaj Coster-Waldau, best known as Jaime Lannister on "Game of Thrones," as warring Egyptian gods. The cast also includes Australian actors Geoffrey Rush, Brenton Thwaites and Courtney Eaton, along with African-American actor Chadwick Boseman and French-Cambodian actress Elodie Yung.

The mostly white cast came under scrutiny as soon as shooting started in 2014. "And so, the time-honored tradition of Hollywood whitewashing continues," Australian writer Ruby Hamad wrote at the time

There was new attention in November, when production company Lionsgate released the first look at the film in character posters and a trailer.

Actress Bette Midler was among those to call out the filmmakers for casting white men in a film based on Egyptian mythology.

"Egyptians, in history and today, have NEVER been white. BRING BACK GEOGRAPHY!! It's Africa!" she said in a tweet

"Dear Hollywood, Egypt is in Africa. Northern to be exact. Why is that so hard to grasp? Stop gentrifying African countries," former NFL player turned filmmaker Matthew A. Cherry said

Why does the Egyptian extras from #GodsOfEgypt look like they're from a Seth Rogen movie? pic.twitter.com/y4Rm4eyjYA — BlackGirlNerds (@BlackGirlNerds) November 12, 2015

In a statement first reported by Forbes on Friday, director Alex Proyas acknowledged the controversy.

"The process of casting a movie has many complicated variables, but it is clear that our casting choices should have been more diverse. I sincerely apologize to those who are offended by the decisions we made," said Proyas, whose director credits include "Dark City" and "I, Robot."

Lionsgate also weighed in on the uproar.

"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 company said in a statement. "Lionsgate is deeply committed to making films that reflect the diversity of our audiences. We have, can and will continue to do better."

Hollywood has a long history of casting actors of European descent to play characters of different races. Even Butler has played a role beyond his ethnic roots, starring as King Leonidas in "300," a character based upon the real-life king of Sparta.

Thanks in part to social media, critics of "whitewashing" have been able to make their grievances known in large numbers in real time. Director Cameron Crowe came under fire for casting Emma Stone as a Hawaiian woman who is one-quarter Chinese in "Aloha," prompting him to apologize. Filmgoers also criticized the choice of white actress Rooney Mara to play the Native American Tiger Lily in "Pan," this year's live-action retelling of Peter Pan.

Forbes contributor Scott Mendelson noted that the apology was different from director Ridley Scott's response to similar criticism for "Exodus: Gods and Kings," the Biblical epic starring Christian Bale as Moses and Australian actor Joel Edgerton as Egyptian King Ramses. Scott defended the casting , saying he needed big-name leads to secure financing for the $140 million project.

The apology from Proyas and Lionsgate might be too little, too late, Mendelson said.

"With the caveat that 'It's my film and I can do what I want!' is a perfectly understandable defense and with the understanding that admitting error on an already in-production film doesn't undo the original subject of discontent, it's a little refreshing to see the respective parties just offer a mea culpa," he wrote.

However, if the film turns out to be a hit, "it will be used as evidence that you can get away with this kind of thing and that you shouldn't take the 'risk' of crafting a movie such as this one with ethnically-accurate casts," he said.