But there was one client who occupied a special place in Roy Cohn’s famously cold heart: Donald J. Trump.

For Mr. Cohn, who died of AIDS in 1986, weeks after being disbarred for flagrant ethical violations, Mr. Trump was something of a final project. If Fred Trump got his son’s career started, bringing him into the family business of middle-class rentals in Brooklyn and Queens, Mr. Cohn ushered him across the river and into Manhattan, introducing him to the social and political elite while ferociously defending him against a growing list of enemies.

Decades later, Mr. Cohn’s influence on Mr. Trump is unmistakable. Mr. Trump’s wrecking ball of a presidential bid — the gleeful smearing of his opponents, the embracing of bluster as brand — has been a Roy Cohn number on a grand scale. Mr. Trump’s response to the Orlando massacre, with his ominous warnings of a terrorist attack that could wipe out the country and his conspiratorial suggestions of a Muslim fifth column in the United States, seemed to have been ripped straight out of the Cohn playbook.

“I hear Roy in the things he says quite clearly,” said Peter Fraser, who as Mr. Cohn’s lover for the last two years of his life spent a great deal of time with Mr. Trump. “That bravado, and if you say it aggressively and loudly enough, it’s the truth — that’s the way Roy used to operate to a degree, and Donald was certainly his apprentice.”

For 13 years, the lawyer who had infamously whispered in McCarthy’s ear whispered in Mr. Trump’s. In the process, Mr. Cohn helped deliver some of Mr. Trump’s signature construction deals, sued the National Football League for conspiring against his client and countersued the federal government — for $100 million — for damaging the Trump name. One of Mr. Trump’s executives recalled that he kept an 8-by-10-inch photograph of Mr. Cohn in his office desk, pulling it out to intimidate recalcitrant contractors.