“A prosecutor would kill for that,” said Solomon L. Wisenberg, a deputy independent counsel in the Whitewater investigation, which did not have the same level of cooperation from President Bill Clinton’s lawyers. “Oh my God, it would have been phenomenally helpful to us. It would have been like having the keys to the kingdom.”

Mr. McGahn’s cooperation began in part as a result of a decision by Mr. Trump’s first team of criminal lawyers to collaborate fully with Mr. Mueller. The president’s lawyers have explained that they believed their client had nothing to hide and that they could bring the investigation to an end quickly.

Mr. McGahn and his lawyer, William A. Burck, could not understand why Mr. Trump was so willing to allow Mr. McGahn to speak freely to the special counsel and feared Mr. Trump was setting up Mr. McGahn to take the blame for any possible illegal acts of obstruction, according to people close to him. So he and Mr. Burck devised their own strategy to do as much as possible to cooperate with Mr. Mueller to demonstrate that Mr. McGahn did nothing wrong.

It is not clear that Mr. Trump appreciates the extent to which Mr. McGahn has cooperated with the special counsel. The president wrongly believed that Mr. McGahn would act as a personal lawyer would for clients and solely defend his interests to investigators, according to a person with knowledge of his thinking.

In fact, Mr. McGahn laid out how Mr. Trump tried to ensure control of the investigation, giving investigators a mix of information both potentially damaging and favorable to the president. Mr. McGahn cautioned to investigators that he never saw Mr. Trump go beyond his legal authorities, though the limits of executive power are murky.