After she won election last year as part of a historic, female-driven wave for House Democrats, the party picked Rep. Katie Hill (Calif.) to be one of its faces of success.

She is young (32), diverse (one of the first openly bisexual members of Congress), politically astute (her first time running for office was for this seat) and from the kind of district that helped the Democrats win back the House last year and that they hope to keep.

But as swift as her rise came her fall. Hill is resigning after less than a year in Congress over allegations she had relationships with staffers. Such relationships violate new House rules passed in the #MeToo era, making her seat potentially more competitive for Republicans. Here’s what happened, from the beginning.

What happened: Hill has acknowledged having a consensual relationship with a campaign staffer but has denied having a relationship with a staffer in her D.C. office. She is resigning after her colleagues launched an ethics investigation into the claims, which were first seen on the conservative website RedState. It’s not immediately clear when she will resign.

Why is she resigning if she is denying some of the accusations? Good question. She denies the more serious claim, that she had a relationship with a congressional staffer. (“Absolutely false,” she said in a statement last week.) It’s more serious because it would break new rules passed last year by the House after the #MeToo movement brought down nine members of Congress. As The Post’s Michelle Ye Hee Lee reports, “It is against the official code of conduct for members to ‘engage in a sexual relationship with any employee’ who works for the member.”

Hill has been somewhat vague about why she is leaving. “I believe it is the best thing for my constituents, my community, and our country” to resign, she said in a statement Sunday. But she has also framed herself as a victim of revenge porn. Sexual photos of her with her campaign staffer were released online, and she has accused her husband, whom she is in the process of divorcing, of being behind that release. She said in her resignation statement that she is pursuing legal options.

“I am saddened that the deeply personal matter of my divorce has been brought into public view and the vindictive claims of my ex have now involved the lives and reputations of unrelated parties,” she said.

There’s some irony — and controversy — to Hill being the first one to lose her seat to these rules: The rules changes were driven by Democrats (though they passed a Republican-led Congress with lots of Republican support and leadership). And they were primarily in response to men leveraging their power for sex. The decades-old rules changes came after these events, as I reported last year:

Lawmakers have been accused of everything from groping a soldier while on a USO tour (resigned Democratic Minnesota senator Al Franken) to writing love notes to a staffer (retiring GOP congressman Patrick Meehan) to offering to pay a staffer $5 million to bear his child (resigned GOP Arizona congressman Trent Franks) to decades of unwanted touching and sexual advances (resigned Michigan Democratic congressman John Conyers Jr.).

To supporters of Hill, or supporters of just having more female members in Congress, it seems unfair. Hill has not been accused of any wrongdoing — an ethics investigation was just getting started. And she was not accused of sexual harassment.

“For decades, male lawmakers got away with those sort of shenanigans,” Los Angeles Times columnist Robin Abcarian wrote under the headline: “Katie Hill messed up but she should not have resigned.” “Wouldn’t you know it, the first one to fall afoul of the rule is a woman, and a bisexual woman, at that.”

There’s also a political irony: During the 2018 campaign, political analysts called Hill “one of the most impressive Democratic contenders of 2018,” and Democratic strategists routinely talked up Hill to reporters as one of their best recruits.

Her first time running for office, she beat a Republican, Steve Knight, in her home district outside Los Angeles, and she quickly became an ally to House Speaker Nancy Pelosi (D-Calif.). She was installed in a powerful position on one of the committees now involved in impeachment proceedings against President Trump, the House Oversight and Government Reform Committee.

Now, Pelosi has indicated it was right for her to resign — even before an ethics investigation in Congress concluded. Hill “came to Congress with a powerful commitment to her community and a bright vision for the future, and has made a great contribution as a leader of the Freshman Class,” Pelosi said in a statement. “She has acknowledged errors in judgment that made her continued service as a Member untenable. We must ensure a climate of integrity and dignity in the Congress, and in all workplaces.”

It’s not immediately clear how competitive this seat becomes with Hill out: Before the allegations, the nonpartisan handicappers at Cook Political Report ranked her district as evenly split between Republican and Democratic voters, with a slight edge to Hill. The area has been trending Democratic and voted for Hillary Clinton in 2016. The Los Angeles Times reports it’s unclear when a special election for her replacement will take place, largely because it is not clear when Hill will leave.

Democrats will be trying to hang onto the 40 seats they won last year, a number of them in districts that also voted for Trump in 2016.