The judge in the Kobe Bryant (search) sexual assault case on Wednesday barred evidence from a medical exam performed on the NBA (search) star, saying investigators didn't have the proper court order to take him to the hospital in the middle of the night.

District Judge Terry Ruckriegle also rejected prosecutors' claims that Bryant had consented to the exam, saying investigators had officially taken him into custody by then.

The judge did deny a defense request to throw out a 75-minute interview of Bryant by detectives and evidence including a T-shirt stained with the alleged victim's blood. Bryant's attorneys said the material was gathered while he was illegally in custody, but the judge disagreed.

Ruckriegle said Bryant willingly talked to the detectives and gave them some of his clothing.

"There was no evidence of any coercion or undue influence put upon Mr. Bryant to either speak to them or to provide the items from his room," Ruckriegle said.

"We're pleased with the ruling and we consider it an important ruling," prosecution spokeswoman Krista Flannigan said. She did not specifically comment on losing the evidence from the medical exam.

After-hours calls left with Bryant's Denver-based defense team were not immediately returned.

Bryant, 25, has pleaded not guilty to felony sexual assault (search) and faces an Aug. 27 trial. He has said he had consensual sex with a front desk worker, now 20, at the Vail-area resort where she worked last summer.

If convicted, Bryant faces four years to life in prison or 20 years to life on probation, and a fine of up to $750,000.

Bryant's attorneys have long criticized the Eagle County sheriff's office, saying investigators improperly questioned Bryant and botched the execution of a court order to gather evidence last July.

Prosecutors had argued in favor of submitting the medical exam and the rest of the evidence, saying that it was collected with Bryant's consent the night after the alleged attack.

During a hearing in February, lead investigator Doug Winters acknowledged that Bryant's hospital examination violated Colorado court rules.

Winters and his partner had obtained a type of warrant for "non-testimonial evidence," which usually involves taking samples of hair and fibers. It must be executed during daylight hours to prevent the government from unnecessarily invading the privacy of citizens.

Bryant's exam was performed before dawn at a Glenwood Springs hospital. The results have not been disclosed.

The judge said a tape recording of the interview with Bryant did not indicate whether the NBA star consented to a hospital exam. But he said an audio expert concluded that Bryant had balked at the request.

"The detective then instructed, 'I have a court order so it doesn't matter whether you consent or not,"' the judge wrote. "The court finds that Mr. Bryant was 'in custody' starting from" that moment — and should have thus been advised of his Miranda rights. By that point, however, Bryant had already spoken with investigators and given them the clothing.

Also Wednesday, Ruckriegle extended what he called a "plea negotiation deadline" until Tuesday because of his order.