The aim of this study was to compare adherence to opioid prescribing guidelines and potential opioid misuse in patients of resident vs attending physicians. Retrospective cross-sectional study. Large primary care practice at a safety net hospital in New England. Patients 18-89 years old, with at least one visit to the primary care clinic within the past year and were prescribed long-term opioid treatment for chronic noncancer pain. Data were abstracted from the electronic medical record by a trained data analyst through a clinical data warehouse. The primary outcomes were adherence to any one of two American Pain Society Guidelines: (1) documentation of at least one opioid agreement (contract) ever and (2) any urine drug testing in the past year, and evidence of potential prescription misuse defined as ≥2 early refills. We employed logistic regression analysis to assess whether patients' physician status predicts guideline adherence and/or potential opioid misuse. Similar proportions of resident and attending patients had a controlled substance agreement (45.1% of resident patients vs. 42.4% of attending patient, P = 0.47) or urine drug testing (58.6% of resident patients vs. 63.6% of attending patients, P = 0.16). Resident patients were more likely to have two or more early refills in the past year relative to attending patients (42.8% vs. 32.5%; P = 0.004). In the adjusted regression analysis, resident patients were more likely to receive early refills (odds ratio 1.82, 95% confidence interval 1.26-2.62) than attending patients. With some variability, residents and attending physicians were only partly compliant with national guidelines. Residents were more likely to manage patients with a higher likelihood of opioid misuse.