Exposure to tobacco during pregnancy is an important risk factor for infant health. Recently the prevalence of smoking during pregnancy has declined in our area. The objective of this study was to analyse the association between several social variables and the fetal exposure to smoking, as well as the association between maternal smoking and some adverse gestational outcomes. Data collection was cross-sectional. The study population were women in the city of Barcelona (Catalonia, Spain) delivering a child without birth defects. The sample corresponded to the controls of the Birth Defects Registry of Barcelona, 2% of all pregnancy deliveries in the city from 1994 to 2003 (n = 2297). Information sources were hospital records and a personal interview of mothers. The analysis measured first the association between independent variables (instruction level, social class, occupation, nationality, planned pregnancy, parity, hospital funding and smoking status of the mother's partner) with two dependent variables: smoking at the initiation of pregnancy and quitting during pregnancy. Second, the persistence of smoking over pregnancy and all independent variables were studied with three variables indicating adverse outcomes of pregnancy: low gestation, low birthweight and intrauterine growth restriction (IUGR). Finally, the joint association between the persistence of smoking over pregnancy and social class taken as independent variables was determined with the three variables indicating adverse outcomes of pregnancy. Logistic regression models were fitted, adjusting for maternal age. Results are presented as odds ratios with their 95% confidence intervals. The prevalence of smoking at the onset of gestation was 41%, and 40% of these women quit during pregnancy, so that 25% delivered as active smokers. Fewer women with higher educational levels and from families with non-manual jobs smoked, as did immigrants, those planning pregnancy and women whose partner did not smoke. Smoking immigrants quit more frequently than nationals, as did those planning pregnancy, primiparae, and women whose partner did not smoke. Low gestation, low birthweight and IUGR were more frequent among smokers and women with a manual occupation, but manual occupation lost its significance when adjusting for smoking. The association between smoking and adverse results was higher for IUGR. In conclusion, the prevalence of smoking and quitting during pregnancy varied according to social factors. The influence of social factors on the outcome of pregnancy was mediated strongly by smoking in a country that provides access to health care free of cost. A priority in reducing inequalities in health is to help women from manual work backgrounds quit smoking.