They met at Le Club, a private disco on the Upper East Side frequented by Jackie Kennedy, Al Pacino, and Diana Ross, according to Trump: The Saga of America’s Most Powerful Real Estate Baron. Donald Trump, the young developer, quickly amassing a fortune in New York real estate and Roy Cohn, America’s most loathed yet socially successful defense attorney who had vaulted to infamy in the 1950s while serving as legal counsel to Senator Joseph McCarthy.

The friendship they forged would provide the foundation for Trump’s eventual presidential campaign. And in hindsight, it serves as a tool for understanding Donald Trump the Candidate, whose bumper sticker-averse declarations—undocumented Mexican immigrants are “criminals” and “rapists”; Senator John McCain is “not a war hero”—have both led him to the top of the Republican primary polls and mistakenly convinced many that he is a puzzle unworthy of solving. It may appear that way, but Trump isn’t just spouting off insults like a malfunctioning sprinkler system—he’s mimicking what he learned some 40 years ago.

A longtime friend of Trump’s who was introduced to the candidate by Cohn told me it’s a shame that Cohn’s not alive to see the chaos his protégé has wrought.

“He would have just loved what’s going on right now,” the friend said. “Roy liked upsetting the establishment.”

Roy Marcus Cohn, born in the Bronx in 1927, was the son of Albert Cohn, a judge and prominent Democrat. He graduated from Columbia Law School in 1947, and the day he was admitted to the bar, according to a New York Times obituary, he got a job in the office of the Manhattan United States Attorney thanks to his father’s connections.

He became known for his arrogant courtroom style, notably in the case of Julius and Ethel Rosenberg, American citizens convicted of conspiring to give information about the atomic bomb to the Soviet Union. They were executed, and Cohn was promoted to assistant U.S. Attorney.

He moved to Washington, where his first assignment was to prepare the indictment of Owen Lattimore, an expert on China and professor at Johns Hopkins University who had been accused of being “the top Russian espionage agent in the United States” by Senator Joe McCarthy.

The charges were ultimately dismissed, but Cohn’s aggressive performance left a lasting impact on McCarthy, who named him chief counsel to the Senate Permanent Subcommittee on Investigations. (Robert F. Kennedy was assistant counsel.)

McCarthy and Cohn, who was gay and would later die of AIDS, claimed that foreign communists had blackmailed closeted homosexual U.S. government employees into giving them secrets. The charge resulted in President Eisenhower’s Executive Order 10450, which allowed the government to deny homosexuals employment.

Cohn helped McCarthy wage similar witch-hunts on the State Department, Voice of America, and the Army.

When McCarthy was finally censured, in 1954, Cohn was thought to be finished, too.

He moved back to New York City and joined the law firm Saxe, Bacon & Bolan. But instead of fading into obscurity, Cohn became a socialite with a roster of high-powered, famous, pious, and allegedly murderous clients.

He represented Andy Warhol, Studio 54, Roman Catholic Cardinals Francis Spellman and Terence Cooke, and mafia leaders Carmine “Cigar” Galante and Anthony “Fat Tony” Salerno.

Cohn’s tactics were thought to be so unethical and dishonest by the legal establishment (he was eventually disbarred) that Esquire dubbed him “a legal executioner.”

The reputation didn’t hurt his dance card, however.

Cohn was known for his parties, thrown at his Greenwich estate and attended by politicians, designers, artists, and celebrities. He liked to pretend that Barbara Walters, a friend, was his girlfriend. “He was a very complicated man,” she told SFGate in 2008. “He was very smart and funny. And, at the time, seemed to know everyone in New York. He was very friendly with the cardinal, he was very friendly with the most famous columnist in New York, Walter Winchell. He had a lot of extremely powerful friends.”

According to The New York Times’ obituary for Cohn, those friends included “dozens of politicians, Democrats and Republicans alike, at every level, from Cabinet members to county judges,” including President Reagan.

Although, Trump’s friend told me, Cohn saw in Trump “front page stuff, and Roy was always attracted to celebrity,” he clearly wasn’t lacking for celebrity in his life. For Cohn, more important than Trump’s status was his attitude.

“I think he saw in Trump a kindred spirit,” the friend said. “He saw a certain toughness that he also saw in himself.”

After graduating from the Wharton School and successfully avoiding deployment to Vietnam, Trump, whose campaign ignored an interview request, joined the family real-estate business and in 1971, moved to a studio apartment on the Upper East Side.

He wasted no time beginning his social ascent.

“One of the first things I did was join Le Club,” he wrote in his 1987 book The Art of the Deal, “which at the time was the hottest club in the city and perhaps the most exclusive—like Studio 54 at its height. Its membership included some of the most successful men and most beautiful women in the world.”

Le Club, Trump wrote, “turned out to be a great move for me, socially and professionally.”

Cohn became Trump’s lawyer. And Trump thought highly of his controversial tactics.

“If you need someone to get vicious toward an opponent, you get Roy,” he was quoted as saying by the Associated Press . “People will drop a suit just by getting a letter with Roy’s name at the bottom.”

In 1973, at Cohn’s urging, Trump sued the federal government for $100 million in damages, after the government sued the Trump Management Corp. for allegedly discriminating against blacks in its leasing of 16,000 apartment units throughout New York.

Trump accused the government of making “irresponsible and baseless” charges. “I have never, nor has anyone in our organization ever, to the best of my knowledge, discriminated or shown bias in renting our apartments,” Trump said at a press conference, held at the New York Hilton Hotel, according to a December 13, 1973 New York Times report. Trump said, in true Trump fashion, that the government had singled out his business because it was big. Cohn, for his part, criticized the government for not providing specifics about the people Trump allegedly discriminated against.

The judge dismissed Trump and Cohn’s suit, saying they were “wasting time and paper.”

And when Trump was accused of using his political connections to manufacture unfair deals for himself, Cohn jumped to his defense. “Donald wishes he didn’t have to give money to politicians, but he knows it’s part of the game,” he told the Times in 1980. “He doesn’t try to get anything for it; he’s just doing what a lot of people in the real estate business try to do.”

But the depth of their relationship didn’t end with Cohn’s attack-dog defenses of his client. Cohn, in his own words to the Times, was “not only Donald’s lawyer, but also one of his close friends.”

When Cohn first got ahold of him, according to his friend, “Donald was a bit of a political neophyte.”

It was Cohn who helped transform him. “His early political training came from Roy,” the friend told me.

Cohn, a registered Democrat, was a Reaganphile. On the grand piano in his law office rested a framed photo of the former president and a letter of thanks he sent to Cohn. He and his law partner, Thomas Bolan, who could not be reached for comment, fundraised tirelessly for his 1980 campaign.

According to Trump’s friend, Cohn acted to “recruit Donald and Donald’s father for Reagan’s finance committee.” In an 1983 Times report, Trump was characterized as a Reagan supporter and was said to have visited the White House “several times.” There’s a picture of the two together, shaking hands. Trump, his hair darker and fuller, in a pinstripe suit and shiny, light pink tie; and Reagan, looking duller by comparison.

Today, Trump’s campaign slogan is “Make America Great Again!” Which was Reagan’s slogan in 1980. Trump has claimed he invented the slogan and trademarked it in order to prevent other candidates from using it in speeches. “I mean, I get tremendous raves for that line,” Trump told The Daily Mail. “You would think they would come up with their own. That is my whole theme.”

In 1983, according to Trump: The Deals and the Downfall, Trump met with Cohn client Anthony “Fat Tony” Salerno, the boss of the Genovese crime family, in Cohn’s New York apartment. Trump had employed S&A Concrete, owned by Salerno and Paul “Big Paul” Castellano, head of the Gambino crime family, to build Trump Tower. (In response to the allegations made in the book, in 1993, Trump said its author, Wayne Barnett, was “a second-rate writer who has had numerous literary failures, who has been writing negative stories about me for the past 15 years. The book is another example of Mr. Barrett’s personal prejudice and animosity towards me. The book is boring, non-factual, and highly inaccurate.”)

A year after the alleged meeting, Trump was doing an interview with The Washington Post. He told the reporter, Lois Romano, that he knew how the United States should negotiate nuclear policy with the Soviets, and Cohn, Trump told her, advised him that it was a good idea to use the interview as an opportunity to talk about the issue.

“Some people have an ability to negotiate,” Trump said. “It’s an art you’re basically born with. You either have it or you don’t.”

I wonder where he learned that.