Just over a decade ago, Donald J. Trump was locked in conflict with a group of apartment owners who had taken control of the condominium board at his new glass tower across from the United Nations. Faced with accusations of financial impropriety and an affront to his authority, Mr. Trump turned to Michael D. Cohen, a former personal injury lawyer who helped run a taxi fleet.

Mr. Cohen did not seem to have extensive expertise in the arcana of New York City condo rules. But he had something Mr. Trump seemed to value more: devotion to the Trump brand. He had already purchased a number of Trump properties and had persuaded his parents, in-laws and a business partner to buy apartments in Mr. Trump’s flashy new development, Trump World Tower.

Plus, he had read Mr. Trump’s book “The Art of the Deal.” Twice.

With Mr. Cohen’s help, Mr. Trump regained control of the board, orchestrating a coup that culminated in a standoff between his security detail and private guards hired by the disgruntled owners, according to people who were there. Details of the dispute’s resolution are secret because of a confidentiality agreement, but Mr. Cohen said that his task was “masterfully accomplished.”

He went on to serve as a key confidant for Mr. Trump, with an office near the boss at Trump Tower on Fifth Avenue. Officially, his title was special counsel, but he appears to have served more as a kind of personal arm-twister. If anyone crossed Mr. Trump or stood in his way, Mr. Cohen, who was known to sometimes carry a licensed pistol in an ankle holster, would cajole, bully or threaten a lawsuit, according to a half-dozen people who dealt with him over the years.