Both Trump and Sanders in their responses mentioned the "liberal media's" agenda to discredit the president, which is something the official mentions in op-ed, calling it Trump's "mass-marketing of the notion that the press is the enemy of the people".
Finally, after the op-ed appeared online Wednesday the president tweeted, "TREASON?"
Members of his administration and inner circle from the vice-president downwards have been lining up to condemn the column and deny authorship.
James Dao, the op-ed editor for the Times, said in the paper's Daily podcast on Thursday, "There's nothing in the piece that strikes me as being relevant to or undermining the national security".
US Secretary of State Mike Pompeo also denied writing it.
He ordered aides to unmask the writer, and issued an extraordinary demand that the newspaper should reveal the author's identity to the government.
Mr Pompeo, previously Mr Trump's Central Intelligence Agency director, said during a trip to India that he was not the author and condemned the Times for publishing it, while Pentagon spokeswoman Dana White said Mr Mattis did not write the piece.
Another said the "Deep State and the Left, and their vehicle, the Fake News Media, are going insane - & they don't know what to do", pointing to the growing U.S. economy as an achievement.
In a rare step, Pence's communications director Jarrod Agen tweeted early Thursday that "The Vice President puts his name on his Op-Eds".
White House spokeswoman Sarah Sanders tried to shut down the speculation. "If I weren't here, I'd believe The New York Times probably wouldn't even exist". He said the author is "failing" and "probably here for all the wrong reasons".
It is sad more than anything else that the USA has come to where you have again. if it is what it's purported to be, it is sad that you have someone who would make that choice, he said.
The op-ed came a day after reports said journalist Bob Woodward's book Fear: Trump in the White House, which is highly critical of the Trump administration, is scheduled to be released on September 11.