Getty

Diddy Judge Orders Prosecution to Destroy Notes From Raid ... 'Get Rid of Them'!

The Feds' raid on Diddy's jail cell has proved to be inconsequential, for now ... as a judge sided with the rapper's defense team after hearing arguments from both sides.

A hearing over the search at MDC Brooklyn was held on Tuesday, after Diddy's defense team accused prosecutors of obtaining privileged material in an unlawful raid on the rap mogul's prison cell.

While the prosecution denied intentionally seizing 19 pages of legal notes, Judge Arun Subramanian ruled they would need to destroy copies of the papers obtained in the search -- saying they should not consult the material until he made a final decision on whether they could be used in the trial.

He ordered prosecutors ... "Get rid of them."

The prosecution previously defended the raid was justified due to Diddy allegedly trying to influence witnesses and prospective jurors with his antics behind bars. Yet, the Bad Boy Records founder's attorney felt the search violated many of the star's rights.

The defense also accused Feds of seizing attorney-client privileged material relating to Diddy's sex trafficking/racketeering trial ... but the prosecution defended that most of the material was personal to the music mogul.

This is just the latest update in what's sure to be a lengthy legal saga for Diddy ... whose trial is set to kick off on May 5.

As TMZ previously reported, Diddy was arrested and indicted in September, charged with racketeering conspiracy, sex trafficking and transportation to engage in prostitution. The rapper pleaded not guilty to the charges ... trying, and failing, to get released on bail twice. His 3rd bail hearing is set for Nov. 22.

Diddy also faces a number of lawsuits, which accuse the star of various misdeeds ... including rape, physical and sexual assault, and trafficking.

TMZ.com

He has denied all the allegations made against him.

Click here for info about our online advertising practices.