WASHINGTON — President Trump on Wednesday angrily denied a New York Times article that said he privately discussed fortifying barriers along the Mexican border with a reptile-filled moat to deter illegal border crossings.

“Now the press is trying to sell the fact that I wanted a Moat stuffed with alligators and snakes, with an electrified fence and sharp spikes on top, at our Southern Border,” Mr. Trump posted on Twitter. “I may be tough on Border Security, but not that tough. The press has gone Crazy. Fake News!”

Mr. Trump amplified his complaints during an Oval Office appearance with President Sauli Niinisto of Finland. But he attributed the article to reporters from The Washington Post rather than The Times. “It’s written by Washington Post people, so you know it’s inaccurate,” he said. “You know it’s probably a fraud.”

Taking aim at the owner of the The Post, the Amazon.com founder Jeff Bezos, Mr. Trump said that Mr. Bezos “ought to be ashamed of himself because what they do to his reputation — I think maybe it’s probably no good anyway, but what they do to his reputation with The Washington Post is a disgrace.”