The opioid crisis has often been fueled by its simultaneous interaction with both medical and illicit markets, including "pill mills" that distribute legal substances in inappropriate and quasi-legal ways. Pain management clinic laws (PMCLs) aim to address this property by enforcing stricter licensing requirements and other regulations on opioid prescribing establishments. Using a difference-in-differences framework and Medicare claims data, we find that PMCLs reduce problematic opioid prescribing and doctor shopping. We also estimate reductions in overdose death rates among the full population. As PMCLs have not been adopted in most states, our results suggest they warrant greater attention from policymakers.