James Comey is a unicorn.

So says a longtime senior law-enforcement official who describes the FBI director as a rarer than rare creature in the nation’s capital. Comey, the official tells The Daily Beast, is a person who says and does exactly what he believes is right even if it is to his political disadvantage.

“That is the FBI director’s big problem,” the official figures. “In a town where almost nothing is on the level, no one knows what to make of a straight shooter.”

The official—who offered The Daily Beast his opinions in writing and in an interview and prefers not to be named—adds: “This is why Comey has almost always been misread in Washington. People have wasted enormous amounts of time trying to determine his hidden motives. It is because they so rarely see the man whose only motive is anything but hidden: to do the right thing. And no wonder they have trouble understanding it. It is Washington, where they have rarely, if ever, seen it before.”

Most recently, this unicorn asked the Justice Department to publicly dismiss President Trump’s claim that his phones were tapped on orders from President Obama.

In making the accusation, Trump was in effect accusing FBI agents as well as Obama of a felony.

In asking for the Justice Department to reject the charge, Comey was in effect calling Trump a liar, albeit not publicly—yet, anyway.

The longtime law-enforcement official suggests that Comey’s sole calculation is, “What are my obligations as an FBI director?”

The official adds, “Agenda; he does not have one. Never has.”

The official notes that Comey has worked for Republicans in the Bush administration and for Democrats in the Obama administration, and remained a unicorn with both.

“Because he has always ignored politics when it comes to the law, he has annoyed his masters in both parties,” the official says.

Just consider what followed in 2003, after folks in the Bush administration leaked that Valerie Plame had been an undercover CIA case officer. The Bush people had apparently been seeking to punish her husband through her and muffle his talk about bad intelligence on the supposed weapons of mass destruction that were used to justify going into Iraq.

Just as our present attorney general, Jeff Sessions, has recused himself from the investigation into the Russians and the Trump campaign, then-Attorney General John Ashcroft recused himself from the Plame investigation.

That left Ashcroft’s then-deputy attorney general, Comey, in charge. Comey decided the matter would be best handled by a special prosecutor, which might have been fine with the Bush people if he had appointed one of the politically connected lawyers who are usually named in such circumstances.

Comey instead chose the Midwest equivalent of a unicorn, the incorruptible, apolitical, and unrelentingly determined Chicago U.S. Attorney Patrick Fitzgerald. The result was that Vice President Dick Cheney’s deputy chief of staff, Scooter Libby, was convicted of perjury and obstruction of justice.

In 2004, the Justice Department’s Office of Legal Counsel came to question the legality of a warrantless wiretapping program called Stellar Wind that Bush had instituted after the 9/11 terror attacks. Ashcroft had made his legal reservations known shortly before the attorney general suddenly fell ill and was rushed to George Washington Hospital for surgery. Comey became the acting attorney general, and the White House sought to get him to approve the program as a deadline for recertification neared. He declined.

On the eve of the deadline, Comey was driving home with his security detail when he got a phone call from Ashcroft’s chief of staff, David Ayres. Ashcroft’s wife had just called Ayres to say a delegation from the White House was heading for the hospital.

Comey had the detail wheel about and head for the hospital with lights and sirens. He arrived soon after and, rather than wait for an elevator, hit the stairs.

“I was concerned that, given how ill I knew the attorney general was, that there might be an effort to ask him to overrule me when he was in no condition to do that,” Comey would testify before Congress.

A White House delegation that included Bush Chief of Staff Andrew Card arrived minutes later and sought to get Ashcroft to sign the necessary papers.

“I was angry,” Comey would testify. “I thought I just witnessed an effort to take advantage of a very sick man, who did not have the powers of the attorney general because they had been transferred to me.”

Ashcroft then roused himself.

“He lifted his head off the pillow and in very strong terms expressed his view of the matter, rich in both substance and fact, which stunned me,” Comey testified.

By Comey’s account, Ashcroft added, “But that doesn’t matter, because I’m not the attorney general. There is the attorney general.”

Ashcroft pointed to Comey, who was then told by Card that he was expected to attend a meeting at the White House later that night. Comey said he would come only if he could bring along then-Solicitor General Theodore Olson.

“After the conduct I had just witnessed, I would not meet with [Card] without a witness present,” Comey testified. “He replied, ‘What conduct? We were just there to wish [Ashcroft] well.’”

The following day, terrorists bombed commuter trains in Madrid, killing more than 200 innocents. The White House went ahead with the warrantless wiretapping absent Justice Department approval. Comey prepared a letter of resignation.

“I couldn’t stay if the administration was going to engage in conduct that the Department of Justice had said had no legal basis,” he later said. “I just simply couldn’t stay.”

Ayres asked Comey to hold off until Ashcroft was well enough to resign with him. Comey agreed. Bush met with Comey and with then-FBI Director Robert Mueller, who can be pretty unicorn-ish himself. Comey and Mueller agreed that they would both resign unless Bush consented to having all such surveillance approved by a panel of judges from the Foreign Intelligence Surveillance Court. Bush blinked.

In the summer of 2005, the unicorn left Washington.

“Comey’s choice of a pit bull, Fitzgerald, to investigate the White House leaks on Plame, then taking on the White House’s signature post-9/11 surveillance program, caused Comey to be looked on by some in Bush’s inner circle as one who was too much of a straight arrow to be trusted in brittle political situations,” the longtime law-enforcement official says.

In 2013, Comey was appointed to succeed Mueller as FBI director. The Obama administration figured this was one nomination it could get through the Senate without much trouble. The Republicans liked that Comey had previously been a Bush appointee. The Democrats liked that he had stood up to the Bush folks at the hospital that night.

Then came the 2016 election.

“Even people who understand [Comey’s] history are confounded by the events surrounding the election,” the longtime law-enforcement official says. “Most of the confusion comes from trying to sort out all the various ulterior motives ascribed to Comey. The reason those calculations never add up correctly is because Comey’s history tells us his motives have never been ulterior. Looking at Comey analytically, the most controversial things he’s done, when viewed politically, are so often against his own interests. “

The official adds, “For Comey, that has simply been the price of playing by the rules in a town where a major pastime is playing with the rules. That leads us to the Clinton matter.”

At the insistence of Republicans in Congress, the FBI investigated whether former Secretary of State Hillary Clinton had broken the law when she used her personal email to conduct government business that sometimes involved classified material. Comey found that Clinton had been reprehensively reckless, but he could discern no criminal intent.

“To career prosecutors at the Justice Department and to the FBI director, it did not appear that Clinton’s email practices would sustain a criminal conviction of either Hillary Clinton or any of her aides,” the longtime law-enforcement official says.

The official also says, “He knows the case is a loser.”

Days before Comey was going to refer the results of the investigation to the Justice Department, planes bearing Attorney General Loretta Lynch and former President Bill Clinton both happened to be at the Phoenix airport. Clinton strode across the tarmac and boarded Lynch’s plane for a little chat.

“I did see President Clinton at the Phoenix airport as he was leaving and spoke to myself and my husband on the plane,” Lynch said afterward. “Our conversation was a great deal about grandchildren, it was primarily social about our travels, and he mentioned golf he played in Phoenix.”

Comey was left in what he viewed as an untenable position.

“Any announcement from Lynch’s Department of Justice was going to look, well, political,” the longtime senior law-enforcement official says.

The official figures that Comey had two choices.

“Between catastrophic and really, really bad,” the official says.

The usual protocol called for Comey to refer his findings to the Justice Department and let it make the prosecutorial determination. Comey decided that circumstances required him to go public. He proceeded to do so.

“Without asking anybody,” notes the longtime law-enforcement official.

Comey announced that he was referring the case with a recommendation that no criminal charges were warranted.

“He didn’t have to do that, but he felt that with all the political spin, people might have more confidence in a judgment by the independent FBI than they might in Obama’s Justice Department,” the longtime law-enforcement official says. “Once again, Comey was willing to take the heat for doing what he believed was the right thing.”

Even some veteran FBI agents who had been among Comey’s greatest admirers since his days as a junior prosecutor in New York felt he had made a mistake in deciding not to charge Hillary Clinton. Republicans in Congress demanded that he come in and explain himself.

Usually, Congress is not empowered to query law-enforcement officials about criminal investigations. The exception is when national security might be at stake. Comey briefed the intelligence oversight committees in the House and the Senate.

“Comey repeated for Congress his rationale to close the case,” the longtime law-enforcement official says. “The last thing Congress demanded of Comey was that if there was any change in the Clinton matter, that they be notified.”

A change nobody could have foreseen came when the NYPD began investigating former New York congressman Anthony Weiner for allegedly engaging in inappropriate conduct online with an underage girl.

When examining the contents of Weiner’s laptop, the FBI discovered that his wife, Huma Abedin, had also used the computer and that it contained thousands of emails involving Clinton.

“The FBI had to review the new emails to determine if they contained new evidence that would change their original judgment on the Clinton case,” the longtime law-enforcement official says. “In ordering this investigation to go forward, Comey had to know he would face more criticism for reopening a case that had already become an investigative Pandora’s box.”

The longtime law-enforcement official figures that Comey now faced three choices, all of them bad:

“Reopen the case and take even more heat; leave the matter alone, because the case was closed; or a third choice some Democratic critics of Comey have suggested: Wait until after the election,” the official says.

The official goes on: “One must ask, what would have happened if Clinton had been elected and the FBI then reopened a criminal investigation? What would have happened if that investigation resulted in a prosecution targeting the sitting president of the United States? Especially when the FBI had access to that evidence before the election? Comey would certainly, and rightly so, be accused of covering up evidence before the election that then resulted in a constitutional crisis.”

The official says Comey’s next move should not have been a surprise.

“Comey did what anyone who studied him could have told you he would do,” the official says. “Of the bad options he had to choose from, he picked the one that would cause himself the most discomfort in every place but his conscience.”

Comey reopened the case. And he felt obligated to make good on his parting pledge to the congressional committees to let them know if anything changed.

“He didn’t announce it,” the longtime law-enforcement official says. “He had testified under oath to Democrats and Republicans on the congressional intelligence committee that the Clinton matter was closed. Comey felt an obligation to tell them that new, potentially relevant material had surfaced. He wrote a sparsely worded letter to the committee chairs indicating that more emails had been found and the FBI had to review them. The politicians leaked it, and then yelled at Comey for the leaks.”

FBI agents worked around the clock to make a determination before the election.

“They found nothing that changed the opinion of career prosecutors at the Department of Justice or FBI director’s original conclusion,” the longtime law-enforcement official says.

Democrats had praised Comey when he initially closed the case, just as Republicans had condemned him. Republicans now praised him for reopening it, just as Democrats now condemned him.

“During the months the Clinton case took, Comey had been accused of having Jekyll and Hyde-like political motives that were so in conflict with each other, anyone without a dog in the fight could tell his motives were anything but political,” the longtime law-enforcement official says.

The official goes on, “Remember, Comey was the one who would not benefit from either outcome of the election. Comey is the FBI director. He was three years into a 10-year term. He had seven years left no matter who got elected.”

As if that were all not enough, Comey now had to pursue a major investigation into what seems to have been a Russian effort to influence the election.

For a second time, Comey has a case that triggered a recusal by the attorney general.

Attorney General Jeff Sessions’s decision to do so is said to have sent Trump into a rage. Trump then flew off to Florida, and, in an early morning hour when he was apparently left unattended, he repeatedly tweeted accusations that he had been wiretapped during the lead-up to the election on orders from Obama.

Trump was intimating that both Obama and the FBI were guilty of a crime. And illegal wiretapping was what Comey and Mueller and Ashcroft had been prepared to resign over during the Bush years.

Comey responded just as a unicorn might. Trump responded just as Trump might, calling for an investigation into the supposed Obama wiretapping.

If Trump will continue to be Trump in the days ahead, then at least we can be sure that Comey will continue to be exactly Comey, our nation’s capital’s only unicorn.