ProPublica is a nonprofit newsroom that investigates abuses of power. Sign up to receive our biggest stories as soon as they’re published.

Rudy Giuliani received a subpoena this week from House Democrats as part of their impeachment inquiry. He wasn’t happy about it. In a tweet on Monday, Giuliani, the president’s personal lawyer, accused the Democratic committee chairs of having “prejudged this case.” He asserted that the subpoena, which seeks “all documents and communications” about Giuliani’s repeated forays into the world of Ukrainian law enforcement and politics, raises “constitutional and legal issues” including “attorney client and other privileges.”

At first blush, it’s a reasonable position. The attorney-client privilege shields confidential communications between a lawyer and his client so long as they pertain to seeking or providing legal advice. Giuliani is an attorney; the president is his client. With a number of exceptions, lawyers do not have to reveal anything about conversations with their clients.

Yet legal experts say Giuliani’s apparent hopes of invoking the privilege to avoid providing documents or testifying may be undercut by his own words — specifically, his habit of announcing in public that he is operating in a nonlegal capacity in his international trips. Those trips are of significant interest to congressional investigators. Communications between President Donald Trump and his lawyer aren’t privileged if their substance falls outside the attorney-client relationship.

Take a recent conversation Giuliani had with a reporter for The Atlantic about his attempts to enlist officials in Kyiv, the Ukrainian capital, to investigate matters that could benefit the president politically. “I’m not acting as a lawyer,” he told the reporter. “I’m acting as someone who has devoted most of his life to straightening out government.”

Giuliani also took pains to say he wasn’t acting as the president’s lawyer when he attended a Kremlin-backed conference in Armenia last October. As ProPublica and WNYC reported, he spoke about cybersecurity and was slated to appear on a panel alongside two advisers to Russian President Vladimir Putin, one of whom was on a U.S. sanctions list. When local reporters caught up with Giuliani, he told them: “I’m not here in my capacity as a private lawyer for President Trump. I’m here as a private citizen.”

At other moments, Giuliani has described himself as Trump’s attorney. For example, he told The New York Times earlier this year that his work in Ukraine was for the benefit of his client, Trump. In that article, Giuliani said he hoped an investigation in Ukraine would turn up information that “will be very, very helpful to my client, and may turn out to be helpful to my government.” (That interview also included a memorable Giuliani comment: “We’re not meddling in an election, we’re meddling in an investigation, which we have a right to do.”)

An assertion of attorney-client privilege generally requires evidence that the lawyer in question was representing the client on the relevant matter. “That is a threshold and essential criterion to even be able to invoke the privilege,” said Stephen Gillers, a legal ethics expert at New York University School of Law. “Is Giuliani acting as a lawyer for the president, giving legal advice and counsel? If that’s not true, then nothing is privileged.”

Neither Giuliani nor his newly retained lawyer, Jon Sale, immediately returned a request for comment.

Over the past year, Giuliani has gone to great lengths to persuade Ukrainian officials to examine two matters on which the president has fixated. The first is a perplexing conspiracy theory that blames Ukraine, rather than Russia, for the hacking of Democratic Party campaign emails during the 2016 election. The other involves questions — but little in the way of facts — about whether Trump’s potential rival in next year’s election, Joe Biden, used his office as vice president to stymie an investigation into a Ukrainian energy company on whose board of directors his son Hunter served. Neither the conspiracy theory nor the Biden-related postulating has been supported by any independent, credible investigations.

A whistleblower complaint filed in August with the inspector general for the intelligence community has raised concerns that Trump abused his office by pushing Ukraine’s president, Volodymyr Zelensky, on a July 25 call, to speak with Giuliani and to pursue the investigations he’s been hawking. White House officials, the whistleblower alleges, then took steps to limit access to records of the call, which Democrats say is evidence of a cover-up. The complaint sparked the ongoing House impeachment inquiry.

Trump and his allies have insisted there was nothing improper about the July 25 call, and Zelensky recently told reporters he did not feel he was being pressured.

Should Giuliani invoke attorney-client privilege and refuse to comply with the subpoena he tweeted about Monday — or to testify before House committees, if subpoenaed to do so — he will almost certainly put his fate in the hands of the courts. The next move for House Democrats, assuming they disagree with Giuliani’s position, would likely be to vote to hold Giuliani in contempt of Congress and then file a lawsuit asking a federal judge to order him to comply with the subpoena. Penalties for failing to comply with a court order include fines and even, in extreme cases, jail time.

Giuliani’s assertion that he wasn’t acting as a lawyer when he lobbied Ukraine will make it harder for him and his client to invoke the attorney-client privilege successfully. It would serve as evidence that conversations or written communications about the lobbying campaign fall outside the attorney-client relationship.

Get Our Top Investigations Subscribe to the Big Story newsletter.

“It doesn’t make things easier” for Giuliani and Trump, said Ronald Minkoff, a partner at the law firm Frankfurt Kurnit Klein & Selz and an expert on attorney ethics. “The client has to establish that the privilege applies. It’s not assumed that the privilege applies.”

A different threat to an attempt to invoke attorney-client privilege could also arise. Congress has taken the position that the separation of powers does not require it to honor the privilege, which is a doctrine created by the judiciary. That stance is as yet untested in court, and in practice, Congress has tended to honor lawyer-client protections.

The attorney-client privilege, moreover, is likely to pertain to only a small number of communications congressional investigators are interested in. Conversations or written communications with people other than Trump or that were disclosed to other people — even discussions with the president that were held in the presence of other U.S. officials — will likely not be privileged. Trump may, however, try to resort to other privileges to keep information from House Democrats, like the executive privilege. In response to recent congressional investigations, White House lawyers have taken an uncommonly broad — and legally uncertain — view of that privilege.

But Giuliani has more on the line than many Trump administration officials who have flouted congressional subpoenas in recent months.

“Giuliani, as a lawyer, may find it hard to ignore a subpoena, on the grounds that he’s a lawyer,” Gillers, the NYU law professor, said. As a member of the New York bar, he is subject to its rules, and “he wouldn’t want to get into trouble with the disciplinary committee.”