Stepping down, she said, was the “best thing for my constituents, my community and our country.” It was unclear when her resignation, which was first reported by Politico, would go into effect.

Ms. Hill, 32, first said she had no intention of resigning last week, after the conservative news site RedState published reports that she had been intimately involved with her legislative director, and separately in a three-way sexual relationship with a young campaign aide and her husband, whom she is divorcing.

In a letter to constituents on Wednesday, the day the ethics committee announced its investigation, Ms. Hill had pledged to “fully and proactively” cooperate with the inquiry and had acknowledged that the relationship with the campaign aide was “inappropriate, but I still allowed it to happen despite my better judgment.”

Ms. Hill also faced the online publication of multiple nude photographs of her, which she said had been done without her permission. She said she knew that if she remained in Congress, “we’ll live fearful of what might come next and how much it will hurt.”

“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,” she said in a statement. Ms. Hill had previously accused her husband, Kenny Heslep, and Republican operatives of “a smear campaign” against her.