Back in December, President Trump tweeted: "After years of Comey, with the phony and dishonest Clinton investigation (and more), running the FBI, its reputation is in Tatters - worst in History! But fear not, we will bring it back to greatness."

The state of play: Now, the FBI is getting its revenge. All at once, Trump is being pounded by the bureau and its alumni, with a three-pronged threat.

The broadest narrative comes from fired FBI director James Comey, who concludes his piercing, detailed attacks in "A Higher Loyalty," out Tuesday: "There is reason to believe this fire will leave the presidency weaker and Congress and the courts stronger, just as the forest fire of Watergate did." On Monday, Comey spent nearly five hours with ABC's George Stephanopoulos (airing at 10 tonight as a "20/20" special). Sources familiar with the Comey interview say ABC has held back some of his strongest news-making bites. A source present at the taping said Comey's comments will "shock the president and his team" and "add more meat to the charges swirling around Trump." The clearest and most immediate threat, in the view of some White House aides, comes from the New York feds' investigation into Trump's longtime lawyer and fixer Michael Cohen, who joined the Trump Organization in 2006. Trump advisers worry Cohen could serve as a Rosetta stone to the past decade of Trump's high-wire business dealings. The raid on Cohen's office has rattled Trump like no previous twist in the investigation. Robert Mueller's investigation has the potential to yield embarrassing revelations about Trump's campaign, transition and presidency, whether clumsy shortcuts or something more. Trump lawyers say the White House turned over more than 20,000 pages of documents, and the campaign provided more than 1.4 million.

Why it matters: As Trump confronts complex international eruptions and prepares for a summit with North Korea, the FBI clearly has taken up residence in his head.

The Twitter rants were nothing compared with his on-camera blast at the federal investigators on Monday: Trump used "disgrace" seven times and "disgraceful" twice, and called the FBI raid on Cohen's office and hotel room (Trump said the agents "broke into the office") "an attack on our country, in a true sense. It's an attack on what we all stand for."

Be smart: The intelligence community, which Trump has also taunted and maligned, could still harbor surprises for a flummoxed president.

One outside ally of the White House told me: "He picked fights with the two institutions that have the ability to find information people want hidden — a serious miscalculation about the relative power arrangements of the pieces of the executive branch."

P.S. To give you a sense of the tack Comey will take on the book tour ahead, he dedicates the book to "my former colleagues, the career people of the Department of Justice and the FBI, whose lasting commitment to truth keeps our country great."

Comey: "We are experiencing a dangerous time in our country, with a political environment where basic facts are disputed, fundamental truth is questioned, lying is normalized, and unethical behavior is ignored, excused, or rewarded."

Get more stories like this by signing up for our daily morning newsletter, Axios AM.