Michael D. Cohen, President Trump’s longtime personal fixer, has lined up a new lawyer, according to people familiar with the matter. The lawyer, Guy Petrillo, once held a senior role in the same federal prosecutors’ office that has been investigating Mr. Cohen for months.

Mr. Cohen’s decision to hire Mr. Petrillo, who ran the criminal division of the United States attorney’s office in Manhattan, comes as that office’s inquiry into Mr. Cohen is nearing a critical phase. For nearly two months, lawyers for Mr. Cohen and Mr. Trump have been working with a court-appointed special master in reviewing a vast trove of documents and data files seized from Mr. Cohen in April in a series of raids on his office, apartment and hotel room. The review is scheduled to end next week, which would move prosecutors closer to deciding whether to file criminal charges.

It is a common practice for people facing scrutiny by prosecutors to hire lawyers who once worked in the offices investigating them. By bringing on Mr. Petrillo, Mr. Cohen will now have an advocate who is well positioned to help him navigate any negotiations with the prosecutors who have spent the past several months looking into his business dealings, including hush-money payments that he made to women who claim they had affairs with Mr. Trump. Those negotiations may eventually include the question of whether Mr. Cohen strikes a deal to cooperate with the government in a separate inquiry by the special counsel, Robert S. Mueller III, into ties between Mr. Trump, his associates and Russia.

For the past few weeks, Mr. Cohen had been in discussions with Mr. Petrillo, who was “consulting with” him even before he was officially retained, one of the people familiar with the matter said. But Mr. Petrillo is not expected to take control of the case until after the document review is finished. The judge, Kimba M. Wood, who is presiding in the matter, has set a tentative deadline of June 25 for the review to be complete.