To pervert the course of justice
If someone perverts the course of justice, they deliberately do something that will make it difficult to discover who really committed a particular crime, for example, destroying evidence or lying to the police. [law]
He was charged with conspiring to pervert the course of justice
Collins Cobuild Dictionary