NEW YORK — A federal judge overseeing an investigation of Rudy Giuliani will appoint an independent attorney to sort through 18 electronic devices seized by federal authorities and shield any content that, because Mr. Giuliani is an attorney, may be off limits to investigators examining his foreign contacts while representing President Donald Trump.

U.S. District Court Judge Paul Oetken on Friday adopted a proposal from prosecutors to appoint what’s called a “special master” to review the materials and filter out items that could be considered privileged, a process expected to take months. Attorney-client privilege applies to communications between a lawyer and a client, and such messages are protected as long as they do not advance criminal activity.

Mr. Giuliani’s lawyers also have argued that executive privilege applies because he represented Mr. Trump during his presidency.

The Justice Department is looking into Mr. Giuliani’s dealings with Ukrainian figures ahead of last year’s election to determine whether, in his bid to find information that would prove damaging to President Joe Biden, he violated a law that requires agents of foreign interests to register with the U.S. government. The former New York mayor, who once led the Manhattan U.S. attorney’s office now scrutinizing his activities overseas, has not been charged with a crime and adamantly denies wrongdoing.

Advertise with us

Two of Mr. Giuliani’s associates who aided his work in Ukraine, Lev Parnas and Igor Fruman, have been charged with campaign-finance violations and other crimes. Both have pleaded not guilty.

Mr. Giuliani was one of Mr. Trump’s most loyal advocates, aggressively working to undermine Biden’s candidacy and, after the election, fiercely pushing the baseless claim that the race was stolen from Mr. Trump because of widespread voter fraud. The claim has been widely disputed by state election officials — Republicans and Democrats alike — across the country.

Mr. Giuliani’s attorney, Robert Costello, said Friday that “we knew that a Special Master was inevitable, which is why we did not oppose it, so this ruling comes as no surprise to us.”

The judge has asked prosecutors, lawyers for Mr. Giuliani and an attorney for another search warrant target, District of Columbia-area lawyer Victoria Toensing, to propose candidates for the special master position by the end of next week. Mike Bowe, Ms. Toensing’s lawyer, declined to comment.

A special master was also appointed when the Manhattan U.S. attorney’s office prosecuted Michael Cohen, another of Mr. Trump’s lawyers, who was imprisoned after pleading guilty to tax evasion, campaign finance violations and lying to Congress.

Advertise with us

The U.S. attorney’s office made a request for a special master shortly after the Giuliani warrant was executed April 28. In recent court filings, his lawyers did not object to the appointment but argued for the process to be put on hold.

FBI agents, acting on warrants, searched Mr. Giuliani’s home and office in Manhattan and collected phones and computers. Prosecutors had already obtained the contents of Mr. Giuliani’s iCloud account from a 2019 warrant to Apple that he was not made aware of until recently. An in-house filter review team at the U.S. attorney’s office is nearly done sorting through the iCloud account, prosecutors have said.

Mr. Giuliani — in an attempt to litigate the legality of the warrants being served on a practicing attorney whose clients expect confidentiality — asked to review the sworn statements from investigators that were submitted to obtain judicial authorization for the searches. The judge denied his request in his ruling and noted that if Mr. Giuliani “is charged with a crime, of course, he will be entitled to production of the search warrant affidavits as part of discovery.”

The judge wrote that Mr. Giuliani’s team cited no legal precedent for “a person who has not been charged a right to review a search warrant affidavit during an ongoing investigation.” The judge’s special-master ruling also rejects requests by Mr. Giuliani’s defense team to be allowed to review the iCloud contents and perform their own analysis of what privileged communications they contain.

The Washington Post’s Tom Hamburger in Washington contributed to this report.