(Reuters) - U.S. President Donald Trump has assailed the Monday raid by Federal Bureau of Investigation agents on the New York offices and home of his personal lawyer Michael Cohen, complaining on Twitter on Tuesday that “attorney-client privilege is dead!”

Michael Cohen, President Donald Trump's personal attorney, looks on as his attorney (not pictured) delivers a statement to reporters after meeting with Senate Intelligence Committee staff on Capitol Hill in Washington, U.S., September 19, 2017. REUTERS/Aaron P. Bernstein

Federal prosecutors in New York obtained search warrants following a referral of evidence from Robert Mueller, the special counsel investigating possible collusion between Trump’s presidential campaign and Russia. Trump has denied colluding with Russia and has repeatedly called Mueller’s probe a “witch hunt.”

Cohen, who has described himself as Trump’s “fix-it guy,” has been at the center of a controversy over a $130,000 payment he made to adult film star Stormy Daniels shortly before the November 2016 election. The actress, whose legal name is Stephanie Clifford, has said she was paid to keep quiet about a decade-old sexual encounter with Trump.

The White House has denied that Trump had sex with Daniels, and Trump has denied any knowledge of the payment.

The following describes the legal doctrine of attorney-client privilege and whether it applies to communications between Trump and Cohen.

What is attorney-client privilege?

Attorney-client privilege is a long-standing doctrine of U.S. law that allows the subject of a lawsuit or criminal case to shield their communications with legal counsel.

Lawyers can invoke the privilege to avoid testifying about conversations with clients or turning over emails or other correspondence. The related work-product privilege covers documents produced in the course of a legal representation.

The traditional justification for attorney-client privilege is that the legal system operates more fairly when people are able to speak candidly with lawyers, said Jens David Ohlin, a professor of criminal law at Cornell Law School.

“If clients feel like whatever they disclose to attorneys will be turned over to authorities, they won’t feel free to talk openly,” Ohlin said.

Does that mean all communications with a lawyer are protected?

No, the privilege only covers communications relating to legal advice, said Lisa Kern Griffin, a former federal prosecutor and a professor at Duke University School of Law. It does not protect a person’s discussion of business, personal, or financial matters with a lawyer if they are unrelated to a legal representation.

Crucially, attorney-client privilege also does not apply to communications by a lawyer in furtherance of a crime or fraud.

Does privilege make it harder to get a warrant to search a lawyer’s office?

Yes. The U.S. Department of Justice has a policy of only raiding law offices if less intrusive approaches, like issuing a request for documents known as a subpoena, could compromise the investigation or result in the destruction of evidence.

Under department policy, the raid of Cohen’s offices required multiple levels of authorization by high-level officials.

“It is very unusual to take such an action,” said Griffin. “It suggests there is deep criminality at issue and real concern that just asking for the documents won’t be enough to ensure they are turned over.”

The application would then need to be approved by a federal judge tasked with determining whether there is probable cause to believe the search would produce evidence of a particular crime.

How can prosecutors make sure they have not improperly obtained privileged information?

Griffin said the search warrant authorizing the raid would have described with specificity the items FBI agents could seize.

Moreover, U.S. courts have said prosecutors must set up a review process to ensure that attorney-client communications are not being improperly used as evidence.

The U.S. Attorney’s Office in Manhattan, which is handling the investigation, will likely have “set up a team of lawyers whose only job and only connection to the case is to determine whether material is privileged or not,” said Ohlin.

This team “would ensure that prosecutors looking into criminality are not exposed to privileged information that could taint their investigation,” said Griffin.

Assessments made by the so-called “dirty team” or “taint team” could be challenged in court by Cohen if he is charged with a crime, Ohlin said.

What if agents find evidence of a crime that is not specifically covered by a warrant?

A narrow warrant does not mean prosecutors must disregard evidence of potential crimes they were not initially investigating, said Andrew Wright, former associate counsel in the Obama White House and a professor at Savannah Law School.

“If police have a warrant to search for a gun and go into a person’s house and find drugs, they can use that evidence,” Wright said. “It is the same thing with business records.”