Washington (CNN) Democratic Rep. Katie Hill of California on Sunday announced her resignation from Congress days after she admitted to having an inappropriate relationship with a campaign staffer before coming into office.

"It is with a broken heart that today I announce my resignation from Congress," Hill said in a statement Sunday. "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."

News of Hill's resignation comes after the House Committee on Ethics announced Wednesday it was opening an investigation into allegations Hill engaged in an improper relationship with a congressional staffer in possible violation of House rules which were changed last year to ban relationships between members and their staff.

In a statement last week, Hill denied that the relationship — allegedly involving Graham Kelly, who currently works as her legislative director — took place. CNN has reached out to Kelly for comment, but has not heard back.

House Speaker Nancy Pelosi said in a statement Sunday night that Hill "has acknowledged errors in judgment that made her continued service as a Member untenable."

While Pelosi praised Hill for making "a great contribution as a leader of the Freshman Class" of House Democrats, she added that "we must ensure a climate of integrity and dignity in the Congress, and in all workplaces."

Hill was elected to Congress in the 2018 midterm elections, defeating a Republican incumbent to represent a swing district. The vice chairwoman of the powerful House Oversight committee, Hill was viewed as a rising star in the party. She played a key role in the Democratic Caucus, representing and advocating for House Democratic freshmen's interests to Democratic leadership.

Last weekend, a conservative blog released intimate photos of Hill, alleging she and her husband had a separate relationship with an unnamed female campaign staffer. That report included three photos of the congresswoman, including an explicit photo. Hill has said that Kenny Heslep, her husband of nine years, with whom she is currently in divorce proceedings, is trying to humiliate her by sharing the photographs. CNN has reached out to Hill's husband for comment but has not heard back. Hill offered no evidence linking her husband to the distribution of the photos.

Hill also reiterated on Sunday that she will pursue legal action regarding the publication of the photographs, saying she has contacted US Capitol Police about the matter.

Last Thursday, a British tabloid published additional intimate photographs of Hill.

Hill said Sunday her resignation "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."

"I know that as long as I am in Congress, we'll live fearful of what might come next and how much it will hurt," she wrote.

"For the mistakes made along the way and the people who have been hurt, I am sorry, and I am learning I am not a perfect person and never pretended to be."

Meteoric rise

Hill ran as a first-time candidate with no political experience. As executive director of a Los Angeles non-profit assisting the homeless, she leveraged her background to raise millions in a grassroots campaign -- with nearly all of the money raised from individual donors.

CNN chronicled Hill's campaign as part of a 'Year of the Woman 2018' political series. In multiple interviews, Hill gave CNN access to her campaign office, events and her extended family.

"We've got to change the face of politics if we want to really get people engaged around politics and mobilize people to affect social change," Hill told CNN before the November 2018 midterms, the daughter of a nurse and a police officer. Hill proudly talked about her bisexual identity, pledging she'd be a voice for the LGBTQ+ community in Washington.

"I've made it very clear through this campaign that I'm not playing by the rules that have been laid out previously," Hill said to CNN last November. "And I think that should be scary to them," she added, referring to the then-GOP incumbent, Steve Knight.

Hill, a millennial, would win by 9 percentage points, flipping a district held by Republicans since the early 1990s.

As Hill opened her congressional office before the inauguration of the 116th Congress last January, she described to CNN what a startling change she was experiencing, going from citizen to candidate to congresswoman so rapidly.

"When I walked through the door, it was definitely a ... well, this doesn't feel like me," Hill said to CNN just hours before she would be sworn into Congress. "I'm used to my office being my two staffers' apartment in this sort of shady part of town with LaCroix cans all over the place. This is ... definitely different."

Hill captured the eye of national Democrats immediately. She joined the House Armed Service Committee and became the Vice Chair of the House Committee on Oversight and Reform.

CNN walked with Hill as she approached the Capitol to be sworn in on January 3. A crush of cameras surrounded the congresswoman-elect as she made her way to the entrance.

"Excited to get to work for sure," Hill said, and then disappeared past the doors reserved for members of Congress.