The federal agency that administers the nation’s presidential libraries criticized a viral tweet sent by the Richard Nixon Presidential Library and Museum that appeared to poke fun at President Trump and his decision to fire James B. Comey, the F.B.I. director.

The tweet, posted Tuesday, sought to snidely distinguish between Mr. Trump’s decision to dismiss the person leading an investigation into his campaign’s ties to Russia and President Richard M. Nixon’s decision in 1973 to accept the resignations of the attorney general and deputy attorney general, who had refused to fire the prosecutor investigating Nixon.

“FUN FACT: President Nixon never fired the Director of the FBI #FBIDirector #notNixonian,” the post said.