Three days before Congress was slated to certify the 2020 presidential election, a little-known Justice Department official named Jeffrey Clark rushed to meet President Donald Trump in the Oval Office to discuss a last-ditch attempt to reverse the results.

Clark, an environmental lawyer by trade, had outlined a plan in a letter he wanted to send to the leaders of key states Joe Biden won. It said that the Justice Department had "identified significant concerns" about the vote and that the states should consider sending "a separate slate of electors supporting Donald J. Trump" for Congress to approve.

In fact, Clark's bosses had warned there was not evidence to overturn the election and had rejected his letter days earlier. Now they learned Clark was about to meet with Trump. Acting attorney general Jeffrey Rosen tracked down his deputy, Richard Donoghue, who had been walking on the Mall in muddy jeans and an Army T-shirt. There was no time to change. They raced to the Oval Office.

As Rosen and Donoghue listened, Clark told Trump that he would send the letter if the president named him attorney general.

"History is calling," Clark told the president, according to a deposition from Donoghue excerpted in a recent court filing. "This is our opportunity. We can get this done."

Donoghue urged Trump not to put Clark in charge, calling him "not competent" and warning of "mass resignations" by Justice Department officials if he became the nation's top law enforcement official, according to Donoghue's account.

"What happens if, within 48 hours, we have hundreds of resignations from your Justice Department because of your actions?" Donoghue said he asked Trump. "What does that say about your leadership?"

Clark's letter and his Oval Office meeting set off one of the tensest chapters during Trump's effort to overturn the election, which culminated three days later with rioters storming the U.S. Capitol. His plan could have decapitated the Justice Department leadership and could have overturned the election.

Clark's actions have been the focus of a Senate Judiciary Committee investigation and an ongoing probe by the Justice Department's inspector general, and now are expected to be closely examined during June hearings by the House committee investigating the insurrection of Jan. 6, 2021.

After the New York Times reported in January 2021 about Clark's actions, he said he engaged in a "candid discussion of options and pros and cons with the president," denied that he had a plan to oust Rosen, and criticized others in the meeting for talking publicly and "distorting" the discussion.

Now, however, key witnesses have provided Congress with a fuller account of Clark's actions, including new details about the confrontation that took place in the Jan. 3 Oval Office meeting, which lasted nearly three hours.

A reconstruction of the events by the Washington Post, based on the court filings, depositions, Senate and House reports, previously undisclosed emails, and interviews with knowledgeable government officials, shows how close the country came to crisis three days before the insurrection.

The evidence, which fills in crucial details about Clark's efforts, includes an email showing he was sent a draft of a letter outlining a plan to try to overturn the election by a just-arrived Justice Department official who had once written a book claiming President Barack Obama planned to "subvert the Constitution."

But larger mysteries could still be solved at an upcoming Jan. 6 committee hearing slated to examine Clark's actions, including the crucial question of whether Clark and his allies were acting on their own initiative — or whether they were one piece of a larger, well-planned effort to keep Trump in power. That question gets to the heart of the committee's professed mission: proving there was a "coordinated, multi-step effort to overturn the 2020 presidential election."

Clark, 55, and his lawyer, Harry MacDougald, declined to comment.

The House committee unanimously voted to hold Clark in contempt of Congress after he declined in December to answer most questions on grounds that his interactions with Trump were privileged. But Clark later appeared before the committee and asserted his Fifth Amendment right against self-incrimination, CNN reported; his testimony from that appearance has not been released.

Sen. Sheldon Whitehouse, D-R.I., who participated in the Judiciary Committee's investigation, said investigators should key in on whether Clark was working on behalf of others not yet identified.

"It certainly could be a symptom of a much larger and more coherent plan than has currently been disclosed," Whitehouse said. Clark "does not appear to have elections expertise or experience, which raises the question, did he really sit down at his computer and type it out or does somebody produce it for him?"

Clark, who attended Harvard and got his law degree from Georgetown, built a career focused on environmental law at the Washington law firm of Kirkland & Ellis and served in the George W. Bush administration's Justice Department.

Clark arrived at Trump's Justice Department in 2018 to head an office that enforces environmental laws and regulations, and then in September 2020 became acting head of the department's civil division.

When Attorney General William Barr resigned as of Dec. 23 after declaring that the Justice Department had not found evidence of mass fraud in Trump's election loss, Rosen became the acting attorney general. Trump, though, complained to Rosen that the Justice Department still wasn't adequately investigating his claims of massive fraud. (A Trump spokesman did not respond to a request for comment.)

Clark would soon emerge as someone interested in pursuing Trump's claims. He found a key ally in Rep. Scott Perry, R-Pa., one of the earliest proponents of Trump's voter fraud claims. Perry later told radio station WITF that he had worked with Clark on "various legislative matters" over the previous four years. When Perry called Donoghue in late December to complain that the Justice Department hadn't sufficiently investigated the election, he mentioned Clark as someone "who could really get in there and do something about this," according to the Senate Judiciary Committee majority report.

Shortly before Christmas, Clark and Perry met, according to the Senate report. Perry told WITF that "when President Trump asked if I would make an introduction, I obliged." A Perry spokesman did not respond to a request for comment.

Clark then met with Trump in the Oval Office, according to the Senate report. When Rosen found out Clark had talked privately with Trump, he was livid, telling Clark in a Dec. 26 phone call that, "You didn't tell me about it in advance. You didn't get authorization. You didn't tell me about it after the fact. This can't happen," according to Rosen's interview with the Senate Judiciary Committee.

Clark was "somewhat apologetic" and promised he wouldn't do it again without permission, according to Rosen. But Clark had already made an impression on the president. The next day, Trump told Rosen in a phone call that "people are very mad with the Justice Department" not investigating voter fraud and referred to having met with Clark.

Rosen told Trump that the Justice Department could not "flip a switch and change the election," according to notes of the conversation cited by the Senate Judiciary Committee.

"I don't expect you to do that," Trump responded, according to the notes. "Just say the election was corrupt and leave the rest to me and the Republican congressmen." The president urged Rosen to "just have a press conference."

Rosen refused. "We don't see that," he told Trump. "We're not going to have a press conference."

A top Clark associate, meanwhile, prepared to send him a draft of the letter to state legislatures.

Kenneth Klukowski had arrived at the Justice Department just two weeks before the Oval Office meeting to become legal counsel to the civil division overseen by Clark.

He had long been an outspoken figure on the right, working as senior legal analyst for the conservative Breitbart website and co-writing a 2010 book about President Barack Obama titled "The Blueprint: Obama's Plan to Subvert the Constitution and Build an Imperial Presidency." Before joining Clark's team, he'd served as special counsel to the White House's Office of Management and Budget, according to his Facebook page.

At 4:20 p.m. on Dec. 28, 2020, he sent an email that has been a central mystery in the Clark episode. The email to Clark, obtained by the Post, has the subject line, "email to you," and an attachment titled "Draft Letter JBC 12 28 20.docx." The email text simply said "Attached." The attached letter, which has been previously released, was titled "Pre-Decisional & Deliberative/Attorney-Client or Legal Work Product - Georgia Proof of Concept."

The House committee has sought to determine if Klukowski wrote the letter and whether he did so alone. Klukowski is cooperating with the committee, according to two people familiar with the matter who spoke on the condition of anonymity to discuss a closed-door session.

In an April court filing, a committee lawyer said there is evidence suggesting the letter "may have been drafted by Ken Klukowski." Whitehouse said he wants to know if someone produced the letter for Klukowski. Klukowski and his lawyer, Edward Greim, declined to comment.

Twenty minutes after Klukowski sent the document, Clark sent Rosen and Donoghue an email with the subject line "Two Urgent Action Items." One was an attachment of the letter that Klukowski had just sent to him. At the bottom of the letter was a place for it to be signed by Rosen, Donoghue and Clark.

"I set it up for signature by the three of us," Clark wrote. "I think we should get it out as soon as possible."

The second item was Clark's request for an intelligence briefing about an allegation that the Chinese were controlling U.S.-based voting machines via internet-connected smart thermostats, a theory that the Justice Department had dismissed as not credible.

Donoghue said in his deposition that he found Clark's proposed letter to state leaders and request for the intelligence briefing to be "very strange" and "completely inconsistent with the department's role ... [and] with what our investigations to date, had revealed."

"There's no chance I would sign this letter or anything remotely like this," Donoghue emailed Clark on the afternoon of Dec. 28, 2020. He stressed that the Justice Department investigations into possible fraud were so small that they "would simply not impact the outcome of the election." Donoghue told Clark that asking the states to reconsider their certified election results "would be a grave step for the Department to take and could have tremendous constitutional, political, and social ramifications for the country."

Rosen summoned Clark to a meeting along with Donoghue. Clark explained that he been looking at allegations on his own and had concerns about the reliability of the election, according to Donoghue's deposition. "He mentioned this smart thermostat thing," Donoghue said, surmising that Clark had read information in lawsuits and "various theories that seemed to be derived from the Internet."

Donoghue told Clark in the meeting that the proposed letter was "wildly inappropriate and irresponsible ... nothing less than the department meddling in the outcome of a presidential election," Donoghue told the Senate committee.

Rosen was stunned. He had known Clark for years and once had worked with him at Kirkland & Ellis. Rosen told the Senate committee that he wondered "what's going on with Jeff Clark. That this is inconsistent with how I perceived him in the past." At several points, Clark asked that the word "acting" be removed from his title as head of the civil division, which Rosen said he declined.

With the meeting concluded, Rosen and Donoghue thought Clark's effort was over. Clark told them, "I think they are good ideas. You don't like them. Okay. Then, I guess we won't do it," according to Rosen's Senate committee interview.

But Clark's effort to woo Trump with his ideas was just beginning.

Several days later, Rosen learned that Clark had once again met with Trump — and once again without informing him in advance, Rosen told the Senate committee. Clark told Rosen that Trump wanted him to consider becoming attorney general. Rosen was livid. "He says he won't do it again. He did it again," Rosen recalled. But Rosen said he did not have the authority to fire Clark, as he would have liked to do, because Clark was a presidential appointee.

Shortly after the clash between Clark and the senior Justice Department officials, Clark told Rosen that if he reversed his position and signed the letter to the Georgia legislature, then Rosen could remain attorney general, Rosen told the Senate committee. Rosen refused. Donoghue told Clark that "you went behind your boss's back, and you're proposing things that are outside your domain and you don't know what you're talking about," Rosen told the Senate committee.

The following day, Jan. 3, 2021, Clark told Rosen that he had just talked with Trump and that "the president had decided to offer him the position, and he had decided to take it. So that I would be replaced that Sunday, and the department would chart a different path," Rosen told the Senate committee.

"I don't get to be fired by someone who works for me," Rosen said he told Clark. Rosen then called and asked to meet with Trump.

Donoghue, meanwhile, had begun taking things off his office wall and packing boxes, presuming he would resign if it was true Clark was about to be named attorney general, Donoghue told the Senate committee.

A meeting in the Oval Office was quickly arranged with Clark, Rosen, and other Justice Department and White House lawyers. Rosen found Trump sitting behind the Resolute Desk, while other White House and Justice Department officials took their seats. Donoghue, still in his muddy jeans and T-shirt, remained outside. The Post had just broken the news that Trump had a day earlier pressured Georgia's secretary of state, Brad Raffensperger, to find enough votes to win the state. Raffensperger had told Trump his allegations of fraud that could overturn the election were baseless.

While Donoghue was watching television coverage about the Post's report, a White House official emerged and said, "The president wants you in this meeting."

Around the time Donoghue entered, Clark was telling Trump that if he became attorney general he would "conduct real investigations that would, in his view, uncover widespread fraud," Donoghue said in his House deposition. Clark vowed to send the letter he drafted to Georgia and other states and said that "this was a last opportunity to sort of set things straight with this defective election, and that he could do it, and he had the intelligence and the will and the desire to pursue these matters in the way that the president thought most appropriate."

Everyone else in the room told Trump they opposed Clark, Donoghue said.

Trump repeatedly went after Rosen and Donoghue, saying they hadn't pursued voter fraud allegations.

"You two," Trump said, pointing to the two top Justice Department officials. "You two haven't done anything. You two don't care. You haven't taken appropriate actions. Everyone tells me I should fire you."

Trump continually circled back to the idea of replacing Rosen with Clark.

"What do I have to lose?" the president asked, according to Donoghue.

"Mr. President, you have a great deal to lose," Donoghue said he responded. "Is this really how you want your administration to end? You're going to hurt the country, you're going to hurt the department, you're going to hurt yourself, with people grasping at straws on these desperate theories about election fraud, and is this really in anyone's best interest?"

Donoghue warned Trump that putting Clark in charge would be likely to lead to mass resignations at the Justice Department.

"Well, suppose I do this," Trump said to Donoghue. "Suppose I replace [Rosen] with [Clark], what would you do?"

"Sir, I would resign immediately," Donoghue said he responded. "There's no way I'm serving under this guy [Clark]."

Trump then turned to Steve Engel, the Justice Department's assistant attorney general for the Office of Legal Counsel, whom Trump reportedly had considered for a seat on the Supreme Court.

"Steve, you wouldn't resign, would you?" Trump asked.

"Absolutely I would, Mr. President. You'd leave me no choice," Engel responded, according to Donoghue's account. Engel declined to comment.

"And we're not the only ones," Donoghue said he told Trump. "You should understand that your entire department leadership will resign. Every [assistant attorney general] will resign. ... Mr. President, these aren't bureaucratic leftovers from another administration. You picked them. This is your leadership team. You sent every one of them to the Senate; you got them confirmed. What is that going to say about you, when we all walk out at the same time?"

Donoghue then told Trump that Clark had no qualification to be attorney general: "He's never been a criminal attorney. He's never conducted a criminal investigation in his life. He's never been in front of a grand jury, much less a trial jury."

Clark objected.

"Well, I've done a lot of very complicated appeals and civil litigation, environmental litigation, and things like that," Clark said, according to Donoghue's deposition.

"That's right," Donoghue said he responded. "You're an environmental lawyer. How about you go back to your office, and we'll call you when there's an oil spill."

Pat Cipollone, the White House counsel, told Trump that Clark's proposed letter was "a murder-suicide pact," according to Donoghue's deposition. "It's going to damage everyone who touches it. And we should have nothing to do with that letter. I don't ever want to see that letter again." Cipollone declined to comment.

Trump made his decision and turned to Clark.

"I appreciate your willingness to do it," Trump said, according to Donoghue. "I appreciate you being willing to suffer the abuse. But the reality is, you're not going to get anything done. These guys are going to quit. Everyone else is going to resign. It's going to be a disaster. The bureaucracy will eat you alive. And no matter how much you want to get things done in the next few weeks, you won't be able to get it done, and it's not going to be worth the breakage."

Clark had yet another idea. He asked whether Engel could provide a formal opinion about what authority Vice President Mike Pence had "when it comes to opening the votes" of the electoral college result on Jan. 6, according to an excerpt of Engel's deposition in a recent court filing.

"That's an absurd idea," Engel said he responded, asserting it wasn't the job of the Justice Department and noting only three days remained before Pence would perform his role. Trump interjected that he didn't want anyone attending the meeting to talk to Pence about what to do on Jan. 6.

"Nobody should be talking to the vice president here," Trump said, according to Engel. Instead, Trump would soon do that himself in an attempt to convince the vice president not to certify Biden's election.

As the Justice Department officials filed out of the White House that night, one grave threat to American democracy had passed.

Three days later, after the president falsely said at a rally that "we won this election, and we won it by a landslide," a pro-Trump mob broke into the Capitol.

The Washington Post's Alice Crites contributed to this report.