FROM LEFT: Donald Trump, New York Mayor Ed Koch and Roy Cohn attend the Trump Tower opening in October 1983 in New York City. (Sonia Moskowitz/Getty Images)

A few minutes before the sun rose over Mar-a-Lago, President Trump was up, thumbing a series of tweets about Barack Obama and some of the darker days of 20th century American history.

In a series of tweets, President Trump accused former President Barack Obama of wiretapping him in October during the late stages of the presidential election campaign, but offered no evidence to support the allegation. (Reuters)

In particular, he was making accusations that Obama had tapped the phones in Trump tower just before the 2016 election — tactics Trump said hearkened to the McCarthy hearings and Red Scare of the late 1940s and ′50s.

“Nothing found,” Trump tweeted. “This is McCarthyism!”

McCarthyism is something of which Trump should have in-depth knowledge.

His lifelong attorney and mentor — Roy Cohn, one of the men who helped mold Trump into Trump — was, as one author called it, Joseph McCarthy's sidekick.

After World War II, McCarthy, a Republican senator from Wisconsin, made claims that large numbers of communist spies and sympathizers had infiltrated the U.S. government and needed to be weeded out.

The accusations happened during a period of escalating tensions with the Soviet Union and growing fears about the global spread of communism. McCarthy interrogated alleged sympathizers at Senate hearings that came to bear his name. Just an accusation could ruin reputations and careers.

Cohn was the brains behind McCarthy's rise to power and, to many Americans, one of the first real television personalities, according to his obituary in The Washington Post.

“Mr. Cohn, with his slick hair, dark complexion and heavy-lidded eyes,” the obit said, “was frequently seen whispering in the senator's ear.”

Eventually, though, Cohn's influence in Washington waned as McCarthy and his hearings lost public support.

Decades later, after Cohn returned to New York, he had Trump's ear.

They first met in New York in October 1973, when Trump was 27 and beginning to make his fortune in his family's real estate business. Cohn, then 46, was a high-profile defense lawyer with connections in city government and in the courts. He used his connections to reward friends and punish opponents, according to The Post's Robert O'Harrow Jr. and Shawn Boburg.

There were, however, legions of Cohn detractors. “He was a source of great evil in this society,” Victor A. Kovner, a Democratic activist in New York City and First Amendment lawyer, told O'Harrow and Boburg. “He was a vicious, Red-baiting source of sweeping wrongdoing.”

Cohn represented Trump and his dad, Fred, when they faced Justice Department allegations that they discriminated against black rental applicants at the apartment complexes the family owned or managed, according to O'Harrow and Boburg.

On Dec. 12, 1973, Cohn called a news conference saying they were suing the government for $100 million over the allegations. In an affidavit, Cohn said the government was trying to force “subservience to the Welfare Department.”

The Trumps ultimately settled the case with the government without admitting guilt — and declared victory.

In the late ’70s and into the 1980s, Cohn fought efforts to have him disbarred. Through it all, Trump was a loyal friend, trophy client and protege.

“Roy had a whole crazy deal going, but Roy was a really smart guy who liked me and did a great job for me on different things,” Trump told The Post, according the story published in June. “And he was a tough lawyer, and that’s what I wanted. Roy was a very tough guy.”

Read more:

This beauty queen was the face of a fake news website. She says she had no idea.

Trump to skip White House correspondents’ dinner: ‘No reason for him to go in and sit and pretend’

Nixon’s former attorney sees ‘echoes of Watergate’ in President Trump’s first month

‘Morning Joe’ host says Kellyanne Conway was banned because ‘everything she said was disproven’