Donald Trump, on just his third day as president, was closing his remarks lauding law enforcement officers at a White House reception when he spied a hard-to-miss figure.
"Oh, there's Jim!" Trump exclaimed as the 6-foot-8 FBI director, James B. Comey, loped across the Blue Room for a presidential hug. "He's become more famous than me!"
Neither man could imagine how soon Trump would add to Comey's fame — or infamy — with the president's stunning sacking on Tuesday of the man leading the investigation of possible ties of Trump campaign officials to Russian meddling in the 2016 election.
Comey gained fame long before Trump, and long before the director's fumbling leadership last year of the FBI inquiry into Hillary Clinton's handling of her emails as secretary of State.
But from Comey's initial celebrity during the George W. Bush administration to the recent controversies, few officials have gone from such heights of public regard to such depths of bipartisan opprobrium, from an image of white knight to one of self-righteous knave.
Comey first became widely known for his actions on a winter night in March 2004 when he dramatically stood up to top Bush administration officials over a domestic surveillance order.
Comey was deputy attorney general, the No. 2 official at the Justice Department, but in March he was heading the agency while Atty. Gen. John Ashcroft recovered from surgery in a hospital near the White House. As acting attorney general, Comey refused to certify as legal a presidential order for warrantless domestic surveillance. So President Bush's White House counsel, Alberto R. Gonzales, and chief of staff, Andrew H. Card Jr., secretly went to the hospital to secure a signature from the enfeebled, barely conscious Ashcroft.
Comey got wind of the gambit and sped to the hospital. There he prevented the senior White House officials from carrying out their plan. Comey subsequently threatened to resign, but he remained at Justice after a private meeting with Bush, who agreed to make changes to the surveillance order that satisfied Comey and the FBI director at the time, Robert S. Mueller III.
Despite his Republican pedigree, Comey was selected by President Obama to replace Mueller atop the FBI in 2013, in part because of his reputation for independence and integrity. The Senate easily confirmed him.
At the bureau, Comey brought to the job long experience as a federal prosecutor, handling cases as diverse as white-collar crime, official corruption and terrorist acts.
But that image for personal and professional rectitude largely unraveled amid his handling of the Clinton investigation, leaving him with few friends in either political party.
Born in New York City and raised in New Jersey, Comey, 56, graduated from William and Mary College, where he studied religion and chemistry. He got a law degree from the University of Chicago. Early in his career he worked in the U.S. attorney's office for the Southern District of New York, a fiefdom he would later head.
Twice he was involved in earlier Clinton-related investigations. During the Clinton administration, Comey was a counsel to the Senate committee investigating the Clintons' Whitewater land deal in Arkansas years earlier, and after Bill Clinton left office, Comey was involved in investigating Clinton's pardon of a fugitive tax evader, the husband of a Clinton donor.
In 2002, George W. Bush named Comey as the U.S. attorney for the Southern District of New York and in December 2003 promoted him to be deputy attorney general. Both posts required Senate confirmation. In 2005, Comey left Justice, and in the years before Obama tapped him for the FBI, he worked as counsel at Lockheed Martin and then Bridgewater Associates, an investment management firm.
His role in the 2016 campaign in investigating Hillary Clinton's handling of classified material pleased neither side in the election. She has joined many other Democrats in blaming Comey, in part, for her loss. And Trump attacked him last summer for deciding not to seek a criminal prosecution of Clinton. Trump lauded the FBI director for reopening the Clinton case just before the election, only to condemn him for then clearing her again.
After his election, Trump said he hadn't decided whether to ask Comey to resign. By a law passed after the Watergate era in response to Richard Nixon's firing of his attorney general amid the scandal probe investigation, the FBI director has a 10-year term that straddles presidencies, to minimize political interference. Days after the inauguration, Comey spread word that Trump had asked him to stay on.
But the tension between the two developed, particularly after Comey disclosed the inquiry into the possible collusion between the Trump campaign and Russia, a story Trump has tried to dismiss as fake.
On May 2, Trump tweeted, "FBI Director Comey was the best thing that ever happened to Hillary Clinton in that he gave her a free pass for many bad deeds!"
The next day White House Press Secretary Sean Spicer said the president remained confident in the FBI director. Yet by Tuesday, Comey was fired and Spicer's deputy, Sarah Huckabee Sanders, said the reason was simple.