The quality of medical care has rarely been evaluated in relation to practitioner or patient gender. Moreover, comparisons between physicians and nonphysicians typically are confounded by practitioner gender. In this study gender and professional role effects were analyzed separately for 162 male and female staff physicians, 191 male and female residents, and 73 female nonphysicians delivering adult and pediatric primary care in 16 ambulatory care practices. Analyses addressed influences of patient and practitioner gender as well as differences between physicians and nonphysicians. Results showed that female staff physicians performed better than male staff physicians for cancer screening in women by breast examination and Pap smears, but that female residents performed worse than male residents for urinary tract infections in children. Patient gender effects occurred for two tasks; for these, superior care was rendered to the gender with higher prevalence for the condition (girls for urinary tract infections, boys for otitis media). The results are considered in the context of the gender-relevance of particular medical tasks or conditions. Comparisons between physicians and nonphysicians were limited to female practitioners. Comparable or superior performance for nonphysicians was found for all tasks but one (cancer screening in women).