ROCHESTER, Mich. — She had paced the halls of the National Archives after dark, reading original copies of America's foundational documents.

She had retreated to her central Michigan family farm for a weekend to pore over the depositions, the transcripts, the evidence — just as she had trained to do as an intelligence analyst.

Finally, she had stayed up late into the night writing an explanation for why she supports impeaching the president of the United States — even though she knows her vote on Wednesday won’t end his tenure in office but may well end hers.

By the time Rep. Elissa Slotkin — a Democrat in Trump country — stepped to the microphone Monday morning in a university ballroom here to address more than 400 constituents, she knew what to expect.

And she got it: A constant chorus of heckling and insults from Trump’s backers, which began even before the 43-year-old freshman lawmaker had said a word and continued as she moved on to other subjects, including her mother’s death from ovarian cancer.

But there were also multiple standing ovations from voters who applauded her decision to, as she described it, follow the facts on a choice more important than any other she has taken, even if it cuts short her political career.

“I will be voting yes,” Slotkin declared as the room simultaneously erupted in cheers and jeers. “I can hear that this is a very controversial decision — and I knew that. All I can ask from the people who are listening is that, while we may not agree, I hope you believe me when I tell you that I made this decision out of principle.”

“Impeach Slotkin!” one man in a red Make America Great Again hat yelled in reply.

“Slotkin is a spy!” shouted another.

“Deep state!” bellowed a third.

Others, staying seated, silently shook their heads.

For an illustration of just how partisan and poisonous the debate over Trump’s impeachment has become these past several months, it would be hard to outdo Monday’s town hall in the frigid quiet of Detroit’s suburbs.

Slotkin, a former CIA officer and Defense Department official, had been among the last publicly undecided House members on impeachment.

Polling shows that the country is almost evenly divided on the question of whether the president should be removed. Despite weeks of public testimony from witnesses, sentiment nationwide has barely budged, with America locked in a partisan standoff that is reflected in the congressional scorecard.

All Republicans — even relatively moderate ones who had once showed a propensity to break with the president — are expected to vote against pushing for Trump’s ouster. Nearly all Democrats are likely to support it. But at least a handful of Democrats are prepared to buck their party’s leadership and vote with the Republicans.

Although the outcome of the vote is not in doubt — Trump is almost certain to become on Wednesday just the third American president to be impeached — Slotkin’s choice has special significance.

She was one of seven “national security Democrats” — all freshmen who won in swing districts, all veterans of the military or defense and intelligence agencies — who in September signed a letter in The Washington Post calling for the House to launch an impeachment inquiry.

Speaker Nancy Pelosi (D-Calif.) did so the very next day.

Like others among the seven, however, Slotkin took her time to announce how she would vote on the two articles of impeachment passed by the Judiciary Committee in a party-line vote last week: one for abuse of power, the other for obstruction of Congress.

Four other moderates joined Slotkin in backing impeachment on Monday: Reps. Joe Cunningham (D-S.C.), Abigail Spanberger (D-Va.), Andy Kim (D-N.J.) and Ben McAdams (D-Utah).

Explaining her choice Monday, Slotkin said she had been deeply reluctant to pursue the president’s ouster. When some Democrats began pushing for impeachment within days of his inauguration, Slotkin recoiled.

She resisted again after special counsel Robert S. Mueller III’s findings suggested a case for obstruction of justice, arguing to activists in her district that voters should decide whether Trump stays or goes in the 2020 election.

But the evidence uncovered during Congress’s inquiry into Trump’s dealings in Ukraine, she said, had changed her calculus: This wasn’t just about Trump’s past behavior. It was about what he was trying to do to influence next year’s vote.

And what he was doing, she told voters at Monday’s town hall, was something she had never seen in her years of government service under Democratic and Republican presidents: Trump using the power of his office “for his own political gain, not for the national security interests of the United States.”

“Isn’t it our constitutional duty to provide a clear response to that abuse of power?” she wrote in a Detroit Free Press op-ed published Monday morning. “Our democracy is in danger if this behavior becomes the new normal.”

Slotkin said she had stayed up into the wee hours Sunday night drafting the piece, following a weekend at her family’s farm where she reviewed documents both new — the inquiry’s voluminous transcripts — and old, including records of previous impeachments.

After a holiday party at the National Archives in Washington last week, she said, she had wandered the building, reading yellowed documents etched in the Founders’ scrawl.

Slotkin told The Post last week that her offices were being inundated with phone calls from constituents wanting to have their say on her impeachment choice. She acknowledged that her district — a band of suburbia and rural countryside north of Detroit — was “overall not supportive of impeachment.”

Slotkin’s district was long held by Republicans, and it went for Trump in 2016 by nearly seven points. But a surge of Democratic support in 2018, especially in suburban areas, propelled her to victory that year by nearly four points.

Slotkin said Monday that she was aware her choice may cost her reelection but that the issue was too important not to do what she believed to be right.

“I feel that in my bones,” she said as her supporters applauded and detractors hooted. “I will stick to that regardless of what it does to me politically, because this is bigger than politics.”

The National Republican Congressional Committee and other GOP-aligned groups have already begun targeting Slotkin’s seat with advertising and aggressive messaging on social media. “Thx to socialist Dems’ obsession w/ impeachment, swing voters are turning into Trump’s base,” the NRCC tweeted after Slotkin’s town hall.

Even some of Slotkin’s supporters expressed fears Monday that she could be damaging herself politically.

“It’s a tough balancing act,” said Rick DesJardins, a retired teacher. “I would hope that she supports impeachment. I also want her to be reelected.”

His friend and fellow former teacher, Dan Christner, said the congresswoman had been left with little choice: Trump was lying and abusing his office with impunity. Someone needed to take a stand.

“The only way we can thwart what’s happening,” he said, “is to do the right thing.”

Slotkin has yet to draw a high-profile challenger for next year’s election, suggesting she may not be as vulnerable as she appears.

Matt Grossmann, director of Michigan State University’s Institute for Public Policy and Social Research, said Slotkin was earning credit for coming to the district to explain her thinking and to argue, as a former national security professional, why she trusts American law enforcement and intelligence agencies.

“People come armed with Fox News talking points to speak against impeachment,” Grossmann said. “But she comes armed with a pretty nice response.”

Although they are not especially well known, a number of Republicans have jumped in to challenge Slotkin next year. One of them, former local television anchor Paul Junge, was on hand Monday to stand alongside Trump’s defenders.

He said impeachment was galvanizing discontent toward Slotkin, who had campaigned in 2018 as a moderate problem-solver.

“She’s not focusing on the things she said she would,” Junge said. “As I travel around the district, I find that impeaching the president is something that people actively oppose. They want their votes to be respected.”

The ones on hand to protest Monday also want Slotkin to know how much they love the president.

“Who’s the greatest president in American history?” one of them called out as a long line of voters prepared to enter the ballroom before the town hall kicked off Monday.

“Trump! Trump! Trump!” came the reply from the president’s backers.

Many held red-and-white signs reading “Impeach Slotkin/Keep Trump.”

The congresswoman’s supporters also showed up in force, squaring off with Trump backers before and during the town hall.

“We’ve got her back,” said Bruce Fealk, a retired court reporter who was organizing a pro-Slotkin rally slated for Tuesday. “She’ll be fine as long as she sticks to her guns.”

As Fealk prepared to enter the ballroom Monday, a Slotkin aide approached him and asked him to help deescalate if tempers began to flare. “I need you to help keep the peace,” she told him.

At several points, tensions appeared poised to spill over. Early on, a Trump backer ripped a sign from the hands of a critic. Later, people on opposite sides of the divide shouted into each other’s faces. And all throughout, Trump backers attempted to shout over Slotkin. But she refused to yield.

“I’m just going to keep on rolling, folks,” she declared as she pressed on with her case.

Afterward, Slotkin said that she had been focused less on the Trump supporters who were heckling her from the back of the room than the ones seated front and center who appeared to be listening, even if they were ultimately unpersuaded.

They “had on their Trump hats and clearly didn’t agree with where I was,” she said. But “they weren’t shouting. They were waiting to hear my answers. And that’s the best I can ask for.”