Michael D. Cohen, the former personal lawyer to President Trump who is under investigation by federal prosecutors in Manhattan, has hired Lanny J. Davis, the Washington lawyer and public relations consultant best known for serving in the Clinton White House, to represent him.

The pairing is unusual. Mr. Davis has tried to position himself as a key defender of Bill and Hillary Clinton — particularly Mrs. Clinton, whom Mr. Trump defeated in the 2016 presidential election and continues to attack as “totally crooked.” Mr. Cohen was once a fierce defender of Mr. Trump.

The president’s allies have long considered the wide-ranging corruption investigation into Mr. Cohen and his business dealings to pose an even more imminent threat to the president than the special counsel investigation. Mr. Davis said he was persuaded to join the legal team after Mr. Cohen said in an interview with ABC News that aired this week that his first allegiance was to his family and to his country, not to the president.

“Like most of America, I have been following the matter regarding Michael Cohen with great interest,” Mr. Davis said in a statement. “As an attorney, I have talked to Michael many times in the last two weeks. Then I read his words published on July 2, and I recognized his sincerity.”