This study investigated whether a Korean national policy prohibiting doctors from dispensing drugs as of 2000 selectively reduced inappropriate antibiotic prescribing in viral illness compared with bacterial illness. We assessed the proportions of episodes prescribed an antibiotic and the number of different antibiotics prescribed for patients with viral and bacterial illness episodes before and after the policy. The nationally representative sample consisted of 50,999 episodes (18,656 viral and 7758 bacterial pre-policy, 16,736 viral and 7849 bacterial post-policy) from 1372 primary care clinics. We used generalized estimating equations to investigate changes in antibiotic prescribing after the policy, and multiple linear regression to determine provider factors associated with reductions in inappropriate antibiotic prescribing for viral illness. After the dispensing restriction, antibiotic prescribing declined substantially for patients with viral illness (from 80.8 to 72.8%, relative risk (RR) = 0.89, [95% confidence interval: 0.86, 0.91], p<0.001), and only minimally for patients with bacterial illness (from 91.6 to 89.7%, RR = 0.98, [0.97, 0.99], p = 0.017). Reductions in antibiotic prescribing were significantly larger (RR = 0.90, [0.87, 0.93], p<0.001) for patients with viral illness. The number of different antibiotics prescribed per episode also decreased significantly after the policy, but there were no significant differences in these reductions between viral and bacterial illness. The dispensing restriction also reduced prescribing of non-antibiotic drugs, with no difference by diagnosis. Provider factors found to be associated with reduced inappropriate antibiotic prescribing were younger age and practice location in an urban area. Prohibiting doctors from dispensing drugs reduced prescribing overall, both of antibiotics and other drugs, and selectively reduced inappropriate antibiotic prescribing in viral illness.