Dr. Lucia Cox, the recently embattled principal of Miami Sunset Senior High School, resigned Wednesday following days of uproar stemming from students' viral social media posts about school conditions.

"Recognizing the best interests of Miami Sunset Senior High School, its students, faculty, and community and standing firmly on the high standards expected at Miami-Dade County Public Schools, today we accepted the early retirement of Dr. Lucia Cox," Alberto Carvalho, Miami-Dade schools superintendent, said in a statement provided to New Times. "Restoring Sunset Senior to its optimal teaching environment is of paramount importance; therefore, a temporary leader will be assigned until a permanent appointment is approved at the next School Board meeting."

See also: Student's Accusations of Filth at Miami Sunset High Spark Official Probe

The abrupt news of Cox's resignation came after several days of turmoil at the school. Last week, New Times reported that the county was investigating reports of filth after pictures showing disgustingly spoiled juice, a bathroom cockroach, and a moldy shower went viral on social media. In the wake of the media firestorm, a group of alumni, as well as several students, claimed Cox was unfairly chilling the students' free speech in her handling of the social media uproar.

"Unfortunately, it has come to our attention that the administration at our alma mater has taken an unusually aggressive stance against free speech," a group of 2004 Sunset alumni wrote in an open letter, "by threatening students with disciplinary action for having expressed legitimate concerns about the safety of their educational environment."

One Sunset student reached by New Times said Cox had enlisted the student government to go classroom to classroom warning students that their privileges would be revoked if they continued criticizing the school on social media. And on January 9, amid talk of a student walkout, Cox took to the school's PA system to lecture students about their behavior:

"It's not fair... that our school is represented in a way, at this moment, that our student body has nothing to do but tweet pictures and post things that are not productive," Cox told the entire school. "I will not tolerate anything that will jeopardize our school's reputation for something [where the] ulterior motive is to disrupt."

A Change.org petition advocating the removal of Cox, started January 17, gathered more than 1,000 signatures within a matter of days, with numerous parents and alumni harshly criticizing the principal over this and other matters.

"I'm signing because my daughter was in that school. Dr. Cox gave up on her and said a lot of disturbing and discouraging things to her," Evelyn Ilampallas wrote.

"I'm signing because my little cousin spent a week hospitalized because of moldy cafeteria juice," Nadia Azzam added.

The student whom New Times contacted said it was true that a student, the senior class president, had indeed spent a week in the hospital after apparent food poisoning contracted from the cafeteria. He also said he saw cockroaches in the building at least twice a week, mold in some areas, and that the boys' bathrooms contained flies. After some students tweeted about conditions on social media, he said, they were forced to write an apology letter or face consequences to be determined by Cox and the superintendent.

Just prior to the announcement of Cox's removal, John Schuster, a spokesman for the district, told New Times that the principal's PA address to students was meant to be in their best interest. "The underlying function here was to maintain student safety," he said. "Principals do that when there is something that is pending."

Update: After the news of Cox's retirement, a group of Sunset students provided the following statement to New Times:

Taking the first steps to make this change happen was a leap of faith that many of us took with some apprehension and uncertainty. The impact that we have made within our local, national, and global community has truly been inspiring. We demanded a clean and safe learning environment and we urged that something be done about the violation of free speech that occurred at Miami Sunset Senior High this past month. We have learned that even in the face of adversity- a group of young and passionate students can persevere. Though administration tried to shut us down, we fought back peacefully and appropriately. The unyielding media support and coverage has assured us that America's core values are still well intact. As we proceed into this new and hopeful phase we would like to thank all of our new friends who helped us make this possible. Thank you to the friends who stood by us, protected us, and helped us get to where we are now: the Alumni of Miami Sunset, Billy Corben, Alfred Spellman, Christina Veiga, Pepe Billete, Trevor Bach, CleanDrop, and every reporter who covered the story through their respective media outlet.

Follow Miami New Times on Facebook and Twitter @MiamiNewTimes.