Beat the rap

To escape conviction and punishment (for a crime).

The man beat the rap and did not have to go to jail.