As President Donald Trump tries to refute the portrayal in the latest attention-grabbing book, he has not only denied saying the things attributed to him, he has denied that he has ever said anything like them. The problem for Trump is that, in some cases at least, the record shows that he has.

“The Woodward book is a scam,” Trump wrote Friday on Twitter about “Fear: Trump in the White House,” the volume to be published by Bob Woodward next week. “I don’t talk the way I am quoted. If I did I would not have been elected President. These quotes were made up.”

In particular, Trump denied calling Attorney General Jeff Sessions “mentally retarded” or a “dumb Southerner,” as the book reports. “I said NEITHER, never used those terms on anyone, including Jeff, and being a southerner is a GREAT thing,” Trump wrote earlier this week.

But, in fact, Trump has used the phrase “mentally retarded” on recorded radio shows that have been unearthed this week. And in a previously unreported incident, a journalist who used to interact with Trump during his days as a real estate developer in New York said this week that he even used the phrase “dumb Southerner” to describe his own in-laws.

Jeane MacIntosh, a former deputy editor at Page Six, the New York Post gossip column that Trump for decades gave stories to, recalled him using the phrase “dumb Southerner” in a very specific context.

MacIntosh had called Trump one day in May 1997 to ask him about a tip she had received that his second wife, Marla Maples, had purchased two gold Lexus cars and that he had made her return them.

“He said, ‘I have something better for you,’ ” MacIntosh recalled in an interview Wednesday. If she dropped that story, he said, he would give her bigger news — that he planned to divorce Maples. When MacIntosh pressed him on why, he “essentially blamed her family,” she said, referring to Maples’ Georgia ­relatives.

“Are you old enough to remember the show ‘The Beverly Hillbillies?’ ” he asked MacIntosh. She replied yes, and Trump laughed and said, “That’s exactly her family, except they came to New York City instead of Beverly Hills.” MacIntosh added, “I said, ‘What do you mean?’ And he said she was constantly surrounded ‘by an entourage of dumb Southerners.’ ” He even adopted a fake southern accent to mimic Maples’ mother, MacIntosh said.

Trump has been known to use the terms “retarded” or “mentally retarded,” as well. In an appearance on Howard Stern’s show on April 16, 2004, Trump used the phrase to denounce a reporter who criticized his business ­dealings.

“I know I was criticized in one magazine where the writer was retarded, he said: ‘Donald Trump put up $7 million, they put up $193 million and they are 50/50 partners. Why isn’t Donald Trump putting up more money?’ And you know it is supposed to be because I am smart,” Trump said.

In another appearance in September of that year, he used it again. “I have a golf pro who’s mentally retard — ,” Trump told Stern, then stopping short as he seemed to catch himself. “I mean he’s really not a smart guy. And I’m playing golf, and I’m thinking about what I’m going to tell NBC and this golf pro comes up to me and tells me, ‘Yeah, but your show is an hour and ‘Friends’ is a half-hour.’ ”

The Daily Beast reported in 2016 that Trump also used to refer to Marlee Matlin, the deaf actress, as “retarded” when she appeared on his television show, “Celebrity Apprentice.”

The White House did not respond to a request for comment, but has issued sweeping denials of Woodward’s book, characterizing it as a work of fiction.

In the book, Trump is quoted disparaging Sessions in a conversation with Rob Porter, then the White House staff secretary. “This guy is mentally retarded,” Trump is quoted saying. “He’s this dumb Southerner.” Trump imitated Sessions’ southern accent and mocked his testimony before Congress when he denied he had talked with Russia’s ambassador to the United States, Woodward reported.

“How in the world was I ever persuaded to pick him for my attorney general?” Trump was said to have asked Porter. “He couldn’t even be a one-person country lawyer down in Alabama. What business does he have being attorney general?”

Whatever the words, the sentiment is consistent with what Trump has said about Sessions in public for more than a year, angry that the attorney general recused himself from overseeing the investigation into Russian interference in the 2016 election and therefore was not able to protect the president.

Trump has publicly called Sessions “very weak,” and “beleaguered,” termed his handling of the Justice Department “disgraceful” and recently questioned his manhood during an interview on Fox News. “What kind of man is this?” he asked.

But using the phrase “dumb Southerner” would risk offending an important part of Trump’s base, and several lawmakers from the South expressed indignation over reports that he said that.

“I’m a Southerner, too,” said Sen. Jim Inhofe, R-Okla. “I think it’s not at all appropriate. It’s totally inappropriate.”