Obstetricians and midwives are exposed to the blood, vaginal secretions and amniotic fluid of their patients during vaginal examinations, deliveries, intracavity procedures and resuscitation of the newborn. They are therefore at risk of hepatitis B virus (HBV) infection that is endemic in developing countries. We studied the knowledge, attitude, and practices of obstetricians and midwives in four teaching hospitals in Southwestern Nigeria with respect to HBV infection. A self-administered questionnaire was used to elicit information about their demographic characteristics, knowledge about, and immunisation against HBV and the use of barrier methods. There were 83 respondents with a mean age of 34.9 years, 45 were midwives while 38 were obstetricians. The former had practised for a range of 2-26 years while the latter had practised for 1-16 years. In a test of knowledge about HBV infection, obstetricians had a mean score of 2.4 while midwives scored 1.8 marks out of five. Only 18.1% had received HBV immunisation and 8.4% always screen their patients for HBV antigens; 33.7% always use barrier methods with the commonest reason for non-use being non-availability. The difference in knowledge between obstetricians and midwives was statistically significant. In conclusion, we make recommendations about reducing the risk of occupationally acquired HBV infection in the labour ward.