Rep. Katie Hill (D-California) is resigning from Congress amid allegations of sexual relationships with subordinates in her office and during her campaign.

“It is with a broken heart that today I announce my resignation from Congress,” Hill wrote in a statement. “This is the hardest thing I have ever had to do, but I believe it is the best thing for my constituents, my community, and our country.”

Hill became embroiled in the scandal after the conservative website RedState.org published nude photos of Hill and wrote that she had an extramarital affair with her legislative director, Graham Kelly. She has denied this allegation.

The House Ethics Committee began investigating Hill on Oct. 23. Hill said she would cooperate with the investigation and admitted to having a relationship with a female staffer during her campaign.

Under a new 2018 House rule, sexual relationships between members and their aides are strictly prohibited. The rule does not explicitly include campaign staff, like the woman Hill had a relationship with. A relationship between Hill and Kelly would fully violate these ethics rules.

British tabloid Daily Mail only added fuel to the scandal, publishing a series of images on Oct. 24 that included nude photos and a picture of her kissing the female campaign staffer. The article alleged that Hill’s staffer was part of a “throuple” with her and Hill’s husband, Kenny Heslep.

Hill and Heslep are undergoing a messy divorce. She has claimed the Heslep abused her, and used the images as revenge porn.

“This is what needs to happen so that the good people who supported me will no longer be subjected to the pain inflicted by my abusive husband and the brutality of hateful political operatives who seem to happily provide a platform to a monster who is driving a smear campaign built around cyber exploitation,” Hill wrote.

Heslep, on the other hand, painted a different picture of their relationship in court documents. He said that his ambitious wife requested that he serve as the homemaker. Divorce proceedings began shortly after Hill was elected.

“Our agreement was that I would stay at home and take care of all the domestic duties and responsibilities while (Hill) worked,” Heslep said in documents filed in July in Los Angeles Superior Court. He did not allege that there was an extramarital affair.

Hill has asked U.S. Capitol Police to investigate potential legal violations for posting and distributing the photos online without her consent. Her lawyers have also sent a cease and desist letter to the Daily Mail  demanding they “remove these photos from publication at once.”

Hill, the second ever openly bisexual House representative, was a favorite of House Speaker Nancy Pelosi (D-California), reportedly viewing her as a younger version of herself.

Hill also served as vice chair of the House Oversight Committee, a rare position for a freshman representative.

Pelosi commended Hill in a statement Sunday for bringing “a powerful commitment to her community and a bright vision for the future” to the House. She added that her “errors in judgement” made her “service as a Member untenable.”

“We must ensure a climate of integrity and dignity in the Congress, and in all workplaces,” Pelosi said.

The complicated scandal drew bipartisan sympathy for the lawmaker. Republican congressman Matt Gaetz (R-Florida) tweeted that Hill was being targeted for her sexuality.

“This is just absurd. The only person who seems to have a gripe is @RepKatieHill’s soon-to be ex,” Gaetz tweeted Thursday. “Who among us would look perfect if every ex leaked every photo/text?”

He added, “Katied isn’t being investigated by Ethics or maligned because she hurt anyone – it is because she is different.”

While Hill did not announce the date she will leave her position, sources familiar with her plans told Politico she may leave as soon as Nov. 1.

SLIDESHOW: TOP DEMOCRATS RUNNING FOR PRESIDENT IN 2020

Hill flipped a GOP seat last election, beating incumbent Steve Knight by nine points. Although Hillary Clinton did win the district in 2016, it is still considered a swing seat.

Chairman of the National Republican Congressional Committee, Tom Emmer (R-Minnesota), said Republicans “look forward to winning back this seat.”

Rep. Cheri Bustos (D-Illinois), who leads the House Democrats’ campaign committee, said there was “no doubt” her party would hold the district next year.