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.

Actress :Rania Youssef @raniayoussef_ Dress : Elizabita franky Mlihigue @Elizabitafranky Makeup Artist : mona Gamal @monagamalmakeup #Elmawardy jewelry # Hair Stylist : Mahmoud Ammer @mahmoud_hair_stylist #cairofilmfestival #cinema #redcarpet #raniah_youseff #mysytle #actress #ciff40 #drama #film

A post shared by Rania Youssef (@raniayoussef_) on

"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."

Rania Youssef 2
Egyptian actress Rania Youssef poses on the red carpet at the closing ceremony of the 40th edition of the Cairo International Film Festival (CIFF) at the Cairo Opera House in the Egyptian capital on November 29, 2018.
SUHAIL SALEH

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