Objective: To determine whether the priority given to patients referred for cardiac surgery is associated with socioeconomic status. Design: Retrospective study with multivariate logistic regression analysis of the association between deprivation and classification of urgency with allowance for age, sex, and type of operation. Multivariate linear regression analysis was used to determine association between deprivation and waiting time within each category of urgency, with allowance for age, sex, and type of operation. Setting: NHS waiting lists in Scotland. Participants: 26,642 patients waiting for cardiac surgery, 1 January 1986 to 31 December 1997. Main outcome measures: Deprivation as measured by Carstairs deprivation category. Time spent on NHS waiting list. Results: Patients who were most deprived tended to be younger and were more likely to be female. Patients in deprivation categories 6 and 7 (most deprived) waited about three weeks longer for surgery than those in category 1 (mean difference 24 days, 95% confidence interval 15 to 32). Deprived patients had an odds ratio of 0.5 (0.46 to 0.61) for having their operations classified as urgent compared with the least deprived, after allowance for age, sex, and type of operation. When urgent and routine cases were considered separately, there was no significant difference in waiting times between the most and least deprived categories. Conclusions: Socioeconomically deprived patients are thought to be more likely to develop coronary heart disease but are less likely to be investigated and offered surgery once it has developed. Such patients may be further disadvantaged by having to wait longer for surgery because of being given lower priority.