The Supreme Court says criminal defendants have a constitutional right to cross-examine the forensic analysts who prepare laboratory reports on illegal drugs and other evidence used at trial.

The court on Thursday ruled 5-4 for a defendant who was convicted of cocaine trafficking, partly because of crime lab analysis.

Luis Melendez-Diaz challenged lab analysis that confirmed cocaine was in plastic bags found in the car he was riding in. Rather than accept the report, Melendez-Diaz said he should be allowed to question the lab analyst about testing methods, how the evidence was preserved and other issues.

Massachusetts courts rejected his arguments.

Justice Antonin Scalia, writing for the high court, said Melendez-Diaz has a constitutional right to confront the lab analyst.