Ms. Tantaros joined Fox as a contributor in 2010, and a year later was named co-host of “The Five,” which aired at 5 p.m. She said in the suit that she was repeatedly told by Fox executives that she could not wear pants on the air because “Roger wants to see your legs.”

Image Roger Ailes. Credit... Drew Angerer/Getty Images

The lawsuit goes on to say that on Aug. 12, 2014, Mr. Ailes called her into his office and asked if she was planning to marry and have children. “Ailes then started complaining about marriage in general, and also made off-color jokes about being married,” the lawsuit states. It describes Mr. Ailes as speculating on the sexual habits and preferences of 10 Fox News personalities.

He asked Ms. Tantaros to turn around “so I can get a good look at you,” the lawsuit charges, adding that Ms. Tantaros refused. Soon after, she was moved from “The Five” to a lower-rated show, “Outnumbered,” that aired at midday.

Mr. Ailes called her back for similar sessions in December 2014 and February 2015, the lawsuit charges, and when she continued to rebuff him, she encountered hostility from the Fox News publicity department. In the February meeting, she said, Mr. Ailes talked about how she would look in a bikini, and accused her of ending a long-term relationship because she had been merely using the man. The episode brought her to tears, the lawsuit states. She said the sole interview arranged by the publicity department during that period was with a writer for a blog controlled by Fox, who asked about her breasts and if she was difficult to work with.

In April 2015, the lawsuit states, Ms. Tantaros met with Bill Shine, then a senior news executive and close aide to Mr. Ailes. She said that she told him about the meetings with Mr. Ailes and asked if he had told the head of publicity for Fox News, Irena Briganti, to go after her. The lawsuit claims that Mr. Shine “told Tantaros that Briganti is like a rabid dog on a chain that we can’t control. Sometimes that dog gets off the chain.” Then, pointing to a picture of Mr. Ailes on a magazine cover, the lawsuit charges, Mr. Shine told her that “this powerful man has faith in Irena Briganti” and that Ms. Tantaros “needs to let this one go.”

Mr. Shine, through a spokeswoman, has said that Ms. Tantaros never approached him about Mr. Ailes harassing her.

Mr. Shine was named co-president of Fox News after Mr. Ailes departed.