A major Hollywood studio is no longer in de-Nile over accusations of whitewashing an upcoming film set in Ancient Egypt.

Gerard Butler, who is not of Middle Eastern descent, on the set of 'Gods of Egypt.'

(infausy-10/17/INFphoto.com)

"Gods of Egypt" director Alex Proyas and Lionsgate, the studio behind the mythological action flick, made unprecedented public apologies Friday amid social media backlash over the lack of racial diversity in the film's cast.

"We recognize that it is our responsibility to help ensure that casting decisions reflect the diversity and culture of the time periods portrayed," a rep for Lionsgate said in a statement, first obtained by Forbes.

"In this instance we failed to live up to our own standards of sensitivity and diversity, for which we sincerely apologize."

At the heart of the controversy over the film opening Feb. 26, is that the cast, headlined by Gerard Butler and "Game of Thrones" actor Nikolaj Coster Waldau, doesn't match the racial makeup of the North African country.

"The process of casting a movie has many complicated variables, but it is clear that our casting choices should have been more diverse," Proyas said his own mea culpa Friday.

Director Alex Proyas made an apology for the lack of diversity in the cast.

(Mark Mainz/Getty Images)

"I sincerely apologize to those who are offended by the decisions we made."

The outrage was stoked earlier this month when the studio released a batch of character photos that would have made the hawk-headed Egyptian god Horus screech:

It seemed a case of the film industry ignoring the old adage that those who ignore history are doomed to repeat it -- since the exact same issue plagued the 2014 biblical epic, "Exodus: Gods and Kings."

Director Ridley Scott's retelling of Moses' battle to free his Jewish brethren against the Egyptian Pharoah showed actors of color as slaves in the background flanking white stars Christian Bale (Moses), Sigourney Weaver (Tuyu) and Edgerton (Ramses). Even the nose on the Sphinx replica used in the movie had been picked apart by online detractors, who decried it as "too European" shaped.