WASHINGTON — The Justice Division’s prime leaders listened in shocked silence this month: One in all their friends, they had been instructed, had devised a plan with President Donald J. Trump to oust Jeffrey A. Rosen as performing legal professional basic and wield the division’s energy to power Georgia state lawmakers to overturn its presidential election outcomes.

The unassuming lawyer who labored on the plan, Jeffrey Clark, had been devising methods to solid doubt on the election outcomes and to bolster Mr. Trump’s persevering with authorized battles and the strain on Georgia politicians. As a result of Mr. Rosen had refused the president’s entreaties to hold out these plans, Mr. Trump was about to determine whether or not to fireplace Mr. Rosen and substitute him with Mr. Clark.

The division officers, convened on a convention name, then requested one another: What is going to you do if Mr. Rosen is dismissed?

The reply was unanimous. They’d resign.

Their casual pact in the end helped persuade Mr. Trump to maintain Mr. Rosen in place, calculating {that a} furor over mass resignations on the prime of the Justice Division would eclipse any consideration on his baseless accusations of voter fraud. Mr. Trump’s determination got here solely after Mr. Rosen and Mr. Clark made their competing instances to him in a weird White Home assembly that two officers in contrast with an episode of Mr. Trump’s actuality present “The Apprentice,” albeit one that might immediate a constitutional disaster.

The beforehand unknown chapter was the fruits of the president’s long-running effort to batter the Justice Division into advancing his private agenda. He additionally pressed Mr. Rosen to nominate particular counsels, together with one who would look into Dominion Voting Programs, a maker of election tools that Mr. Trump’s allies had falsely mentioned was working with Venezuela to flip votes from Mr. Trump to Joseph R. Biden Jr.

This account of the division’s ultimate days beneath Mr. Trump’s management relies on interviews with 4 former Trump administration officers who requested to not be named due to concern of retaliation.

Mr. Clark mentioned that this account contained inaccuracies however didn’t specify, including that he couldn’t talk about any conversations with Mr. Trump or Justice Division legal professionals due to “the strictures of authorized privilege.” “Senior Justice Division legal professionals, not uncommonly, present authorized recommendation to the White Home as a part of our duties,” he mentioned. “All my official communications had been in keeping with regulation.”

Mr. Clark categorically denied that he devised any plan to oust Mr. Rosen, or to formulate suggestions for motion based mostly on factual inaccuracies gleaned from the web. “My observe is to depend on sworn testimony to evaluate disputed factual claims,” Mr. Clark mentioned. “There was a candid dialogue of choices and professionals and cons with the president. It’s unlucky that those that had been a part of a privileged authorized dialog would remark in public about such inside deliberations, whereas additionally distorting any discussions.”

Mr. Clark additionally famous that he was the lead signatory on a Justice Division request final month asking a federal choose to reject a lawsuit that sought to strain Vice President Mike Pence to overturn the outcomes of the election.

Mr. Trump declined to remark. An adviser mentioned that Mr. Trump has persistently argued that the justice system ought to examine “rampant election fraud that has plagued our system for years.”

The adviser added that “any assertion on the contrary is fake and being pushed by those that want to preserve the system damaged.” Mr. Clark agreed and mentioned that “authorized privileges” prevented him from divulging specifics relating to the dialog.

A Justice Division spokesman declined to remark, as did Mr. Rosen.

When Mr. Trump said on Dec. 14 that Lawyer Normal William P. Barr was leaving the division, some officers thought that he may enable Mr. Rosen a brief reprieve earlier than urgent him about voter fraud. In any case, Mr. Barr could be round for an additional week.

As an alternative, Mr. Trump summoned Mr. Rosen to the Oval Workplace the subsequent day. He needed the Justice Division to file authorized briefs supporting his allies’ lawsuits in search of to overturn his election loss. And he urged Mr. Rosen to nominate particular counsels to analyze not solely unfounded accusations of widespread voter fraud, but in addition Dominion, the voting machines agency.

(Dominion has sued the pro-Trump lawyer Sidney Powell, who inserted these accusations into 4 federal lawsuits about voter irregularities that had been all dismissed.)

Mr. Rosen refused. He maintained that he would make choices based mostly on the details and the regulation, and he reiterated what Mr. Barr had privately instructed Mr. Trump: The division had investigated voting irregularities and located no proof of widespread fraud.

However Mr. Trump continued to press Mr. Rosen after the assembly — in telephone calls and in particular person. He repeatedly mentioned that he didn’t perceive why the Justice Division had not discovered proof that supported conspiracy theories in regards to the election that a few of his private legal professionals had espoused. He declared that the division was not preventing onerous sufficient for him.

As Mr. Rosen and the deputy legal professional basic, Richard P. Donoghue, pushed again, they had been unaware that Mr. Clark had been launched to Mr. Trump by a Pennsylvania politician and had instructed the president that he agreed that fraud had affected the election outcomes.

Mr. Trump rapidly embraced Mr. Clark, who had been appointed the performing head of the civil division in September and was additionally the pinnacle of the division’s environmental and pure sources division.

As December wore on, Mr. Clark talked about to Mr. Rosen and Mr. Donoghue that he spent loads of time studying on the web — a remark that alarmed them as a result of they inferred that he believed the unfounded conspiracy idea that Mr. Trump had received the election. Mr. Clark additionally instructed them that he needed the division to carry a information convention asserting that it was investigating critical accusations of election fraud. Mr. Rosen and Mr. Donoghue rejected the proposal.

As Mr. Trump targeted more and more on Georgia, a state he misplaced narrowly to Mr. Biden, he complained to Justice Division leaders that the U.S. legal professional in Atlanta, Byung J. Pak, was not looking for proof for false election claims pushed by Mr. Trump’s lawyer Rudolph W. Giuliani and others. Mr. Donoghue warned Mr. Pak that the president was now fixated on his workplace, and that it won’t be tenable for him to proceed to steer it, in line with two individuals acquainted with the dialog.

That dialog and Mr. Trump’s efforts to pressure Georgia’s Republican secretary of state to “discover” him votes compelled Mr. Pak to abruptly resign this month.

Mr. Clark was additionally targeted on Georgia. He drafted a letter that he needed Mr. Rosen to ship to Georgia state legislators that wrongly mentioned that the Justice Division was investigating accusations of voter fraud of their state, and that they need to transfer to void Mr. Biden’s win there.

Mr. Rosen and Mr. Donoghue once more rejected Mr. Clark’s proposal.

On New Yr’s Eve, the trio met to debate Mr. Clark’s refusal to hew to the division’s conclusion that the election outcomes had been legitimate. Mr. Donoghue flatly instructed Mr. Clark that what he was doing was incorrect. The following day, Mr. Clark instructed Mr. Rosen — who had mentored him whereas they labored collectively on the regulation agency Kirkland & Ellis — that he was going to debate his technique with the president early the subsequent week, simply earlier than Congress was set to certify Mr. Biden’s electoral victory.

Unbeknown to the performing legal professional basic, Mr. Clark’s timeline moved up. He met with Mr. Trump over the weekend, then knowledgeable Mr. Rosen noon on Sunday that the president supposed to exchange him with Mr. Clark, who may then attempt to cease Congress from certifying the Electoral Faculty outcomes. He mentioned that Mr. Rosen may keep on as his deputy legal professional basic, leaving Mr. Rosen speechless.

Unwilling to step down with out a combat, Mr. Rosen mentioned that he wanted to listen to straight from Mr. Trump and labored with the White Home counsel, Pat A. Cipollone, to convene a gathering for early that night.

Whilst Mr. Clark’s pronouncement was sinking in, gorgeous information broke out of Georgia: State officers had recorded an hourlong name, published by The Washington Post, throughout which Mr. Trump pressured them to fabricate sufficient votes to declare him the victor. Because the fallout from the recording ricocheted by means of Washington, the president’s determined bid to alter the end result in Georgia got here into sharp focus.

Mr. Rosen and Mr. Donoghue pressed forward, informing Steven Engel, the pinnacle of the Justice Division’s workplace of authorized counsel, about Mr. Clark’s newest maneuver. Mr. Donoghue convened a late-afternoon name with the division’s remaining senior leaders, laying out Mr. Clark’s efforts to exchange Mr. Rosen.

Mr. Rosen deliberate to quickly head to the White Home to debate his destiny, Mr. Donoghue instructed the group. Ought to Mr. Rosen be fired, all of them agreed to resign en masse. For some, the plan delivered to thoughts the so-called Saturday Night time Bloodbath of the Nixon period, the place Lawyer Normal Elliot L. Richardson and his deputy resigned slightly than perform the president’s order to fireplace the particular prosecutor investigating him.

The Clark plan, the officers concluded, would critically hurt the division, the federal government and the rule of regulation. For hours, they anxiously messaged and referred to as each other as they awaited Mr. Rosen’s destiny.

Round 6 p.m., Mr. Rosen, Mr. Donoghue and Mr. Clark met on the White Home with Mr. Trump, Mr. Cipollone, his deputy Patrick Philbin and different legal professionals. Mr. Trump had Mr. Rosen and Mr. Clark current their arguments to him.

Mr. Cipollone suggested the president to not hearth Mr. Rosen and he reiterated, as he had for days, that he didn’t suggest sending the letter to Georgia lawmakers. Mr. Engel suggested Mr. Trump that he and the division’s remaining prime officers would resign if he fired Mr. Rosen, leaving Mr. Clark alone on the division.

Mr. Trump appeared considerably swayed by the concept firing Mr. Rosen would set off not solely chaos on the Justice Division, but in addition congressional investigations and probably recriminations from different Republicans and distract consideration from his efforts to overturn the election outcomes.

After practically three hours, Mr. Trump in the end determined that Mr. Clark’s plan would fail, and he allowed Mr. Rosen to remain.

Mr. Rosen and his deputies concluded that they had weathered the turmoil. As soon as Congress licensed Mr. Biden’s victory, there could be little for them to do till they left together with Mr. Trump in two weeks.

They started to exhale days later because the Electoral Faculty certification on the Capitol acquired underway. After which they acquired phrase: The constructing had been breached.

Maggie Haberman contributed reporting from New York.