BERKELEY HEIGHTS, N.J. — President Trump on Saturday vented about a secret recording taped by his former attorney and seized by the FBI, calling both actions “inconceivable” and maintaining that he did nothing wrong.

In a morning tweet from his golf course in Bedminster, N.J., Trump said that it was “Inconceivable that the government would break into a lawyer’s office (early in the morning) — almost unheard of.”

“Even more inconceivable that a lawyer would tape a client — totally unheard of & perhaps illegal,” Trump added. “The good news is that your favorite President did nothing wrong!”

New York is a “one-party consent” state, meaning that in general, it is legal to record a conversation as long as at least one party agrees, even if that person is the one doing the recording. In addition, Trump’s attorneys have not claimed the recording is a privileged attorney-client conversation, a person familiar with the investigation told The Washington Post on Friday.

The “break into” phrase referenced by Trump was actually the raiding by FBI agents in April of the Manhattan office and residences of Trump’s then-personal attorney, Michael Cohen, who is being investigated for potential bank and election-law crimes. The raid, conducted under a search warrant, was aimed at seizing records related to two women who received payments in the run-up to the 2016 election after they alleged extramarital affairs with Trump, among other documents.

In an interview this month with ABC News, Cohen himself described the FBI agents who conducted the raid as “respectful, courteous and professional” and said he thanked them and shook hands with them as they left.

“I don’t agree with those who demonize or vilify the FBI,” Cohen told ABC’s George Stephanopoulos. “I respect the FBI as an institution, as well as their agents.”

Three women, Stormy Daniels, Karen McDougal and Summer Zervos, have filed various lawsuits related to encounters with President Trump. (Joyce Koh/The Washington Post)

On Friday, three people with knowledge of the conversation told The Post that Cohen had secretly taped a conversation with Trump in September 2016 about whether to purchase the rights to the story of one of those women, Playboy centerfold Karen McDougal.

The recording was among the records seized in the FBI raid, multiple people familiar with the probe said.

One month before the conversation, AMI, the parent company of the National Enquirer, bought the rights to McDougal’s story for $150,000, then shelved it. Trump’s attorney Rudolph W. Giuliani said in a statement Friday that the recording is “powerful exculpatory evidence,” because it does not contain anything suggesting that Trump knew about that payment in advance.

But the recording does show that Trump was considering buying the rights to McDougal’s story from AMI — despite the fact that Trump’s spokeswoman at the time, Hope Hicks, called McDougal’s claims “totally untrue” and said Trump had “no knowledge of any of this.”

Cohen’s lawyer, Lanny Davis, fired back at Trump with a tweet later Saturday morning, saying the president’s statement against Cohen was false and mocking the Trump legal team’s strategy as “flawed.”

“Rudy claims the tape is ‘exculpatory,’ ” Davis said, referring to Giuliani. “Why so angry?”

Carol D. Leonnig and Rosalind S. Helderman contributed to this report.