Washington (AFP) - A furious Donald Trump called Wednesday for the unmasking of an anonymous senior official who wrote in the New York Times that top members of his administration were undermining the president to curb his "misguided impulses."

Trump asked if the unsigned op-ed could be considered treasonous, assailed the newspaper for the "gutless" piece and questioned whether the senior official it was attributed to actually existed.

"TREASON?" Trump posted in response to the article entitled "I Am Part of the Resistance Inside the Trump Administration," which claimed the president's own staff see him as a danger to the nation.

"Does the so-called 'Senior Administration Official' really exist, or is it just the Failing New York Times with another phony source?" Trump tweeted.

"If the GUTLESS anonymous person does indeed exist, the Times must, for National Security purposes, turn him/her over to government at once!"

In the article, the official stressed they were committed to the Republican agenda, and did not side with opposition Democrats.

But, the official wrote, "we believe our first duty is to this country, and the president continues to act in a manner that is detrimental to the health of our republic."

"Many of the senior officials in his own administration are working diligently from within to frustrate parts of his agenda and his worst inclinations," the official wrote.

"I would know. I am one of them."

The piece was published a day after excerpts from a bombshell book that also claimed that White House staff were constantly battling to rein in the president's worst impulses.

The Times acknowledged the "rare step" of publishing an anonymous editorial but said the official's job would be jeopardized if they were identified, and that the paper knew who had written the piece.

"We believe publishing this essay anonymously is the only way to deliver an important perspective to our readers," the paper said.

- 'The president's amorality' -

Story continues

The official's piece described a "two-track" presidency in which Trump says one thing and his staff consciously does another, for example with regard to what he called the president's "preference for autocrats and dictators."

Staff actively worked to insulate themselves from Trump's "impetuous, adversarial, petty and ineffective" leadership style, the writer said.

"The root of the problem is the president's amorality," the official said. "That is why many Trump appointees have vowed to do what we can to preserve our democratic institutions while thwarting Mr Trump's more misguided impulses until he is out of office."

Trump lashed out at the author and at the "dishonest" Times.

"They don't like Donald Trump and I don't like them," Trump said. "So if the failing New York Times has an anonymous editorial, can you believe it, anonymous -- meaning gutless -- a gutless editorial -- we're doing a great job."

White House spokeswoman Sarah Sanders branded the piece "pathetic, reckless, and selfish" and condemned the Times for publishing it.

"Nearly 62 million people voted for President Donald J. Trump in 2016," said Sanders. "None of them voted for a gutless, anonymous source to the failing New York Times."

The unsigned piece appeared to reinforce the claims made in the new book by investigative journalist Bob Woodward, which describes a virtual cabal of like-minded White House and cabinet officials scheming to prevent Trump from taking decisions damaging to the US economy and national security.

The writer of the Times op-ed suggests that dissent and resistance inside Trump's White House are even deeper than Woodward described.

The official said that early on in the administration, some officials quietly discussed invoking the 25th amendment of the US Constitution, which allows the removal of a president judged unable to perform his duties.

"But no one wanted to precipitate a constitutional crisis. So we will do what we can to steer the administration in the right direction until -- one way or another -- it's over."