A real-time PCR assay targeting the cylB gene was developed to detect Streptococcus agalactiae [Lancefield group B Streptococcus (GBS)] from clinical samples. A total of 110 blood culture-negative samples [75 cerebrospinal fluid (CSF) and 35 EDTA blood samples] from neonates with probable GBS sepsis or meningitis were analysed. Among these, 16 of the 75 CSF samples were positive [21.3%, 95% confidence interval (CI) 12.7-32.3%] and two of the 35 EDTA blood samples were positive (5.7%, 95% CI 0.7-19.2%). The proportion testing positive in the CSF samples was significantly higher than in the EDTA blood samples (P=50.05, Fisher's exact test). Overall, this real-time PCR assay was shown to be superior to culture methods for detection of GBS from CSF and EDTA blood samples.