Bovine mastitis caused by Streptococcus agalactiae is mainly subclinical and therefore can be diagnosed only in the laboratory. A nested polymerase chain reaction (PCR)-based method for specific, sensitive and rapid detection of S. agalactiae in raw milk was developed. The general streptococci primers, which anneal to conserved areas within the 16S rRNA subunit gene, were used as positive controls. The specificity of S. agalactiae primers is based on various areas within conserved areas of the 16S rRNA genes of S. agalactiae. Results have indicated that the method enables the detection of 1 CFU/ml of S. agalactiae in raw milk after enrichment, followed by DNA extraction using a rapid and simple procedure developed for this purpose, and specific PCR reaction. The method developed can be used efficiently in the early infectious status investigation of S. agalactiae in the dairy herd and in prevention and control of S. agalactiae spread in a herd.