New York City Ballet fired two principal male dancers on Saturday morning after they were named in a lawsuit in which a woman accused a third dancer of inappropriately sharing texts of sexually explicit photographs.

City Ballet said it moved to act after assessing the conduct of the dancers and its impact on the company.

The company dismissed Amar Ramasar, one of its brightest stars, and Zachary Catazaro after they were implicated in a photo-sharing scandal that has roiled City Ballet and now created a significant gap in its male roster just before its fall season begins.

The third dancer, Chase Finlay, resigned last month. He was accused in the lawsuit of sending explicit pictures and videos of Alexandra Waterbury, a young woman he had been dating, to his friends without her consent, and asking others to send back explicit photos of their own. The episode has now forced out three of the 14 male principal dancers in the close-knit company.