Egyptian actress Rania Youssef may have avoided the fashion police, but not Egyptian authorities.

Youssef, 45, was charged with public obscenity for wearing a revealing black gown to the closing ceremony of the Cairo International Film Festival last week. The dress featured a black bodysuit covered in a sheer, beaded overlay that showcased her legs.

Once images of her red carpet attire made waves on social media, a pair of lawyers filed a lawsuit against the actress, accusing her of "inciting debauchery." The complaint could land Youssef in prison for five years if convicted.

Youssef took to her Instagram page, where she posted images of her red carpet attire, to apologize for those she offended and angered.

"I probably miscalculated when I chose to wear this dress. …It was the first time that I wore it and I did not realize it would spark so much anger," the actress wrote in a statement posted to her account, adding that fashion designers were possibly influenced by trends at international film festivals.

Youssef continued: "I reaffirm my commitment to the values upon which we were raised in Egyptian society."

Youssef will stand trial on Jan. 12.

Egypt's Actors Guild, meanwhile, said in a statement that it intended to investigate and discipline actors who wore "inappropriate" attire during the opening and closing ceremonies of the week-long film festival, arguing that they clashed with "the traditions, values and ethics of society."

"Although we absolutely believe in the personal freedom of artists, we appeal to everyone to shoulder their responsibilities toward the fans who appreciate their art and view them as role models," said the weekend statement. "That should compel them to exercise a minimum level of commitment to society's public values."

Egypt is a mostly conservative country with a Muslim majority. The Arab country of 100 million people has retained vestiges of secularism, despite decades of growing religious conservatism, but Youssef's case serves as a reminder that Islamic fundamentalism still pervades society five years after an Islamist president was ousted by the military.

Contributing: The Associated Press

More:Brad Pitt and Angelina Jolie set to take custody battle over their six kids to a 'private' trial

Also:Madonna's daughter Lourdes wears revealing sheer dress, shows off unshaven legs