Background: Syphilis remains a significant cause of preventable perinatal death in developing countries, with many women remaining untested and thus untreated. Syphilis testing in the clinic (on-site testing) may be a useful strategy to overcome this. We studied the impact of on-site syphilis testing on treatment delays and rates, and perinatal mortality. Methods: We conducted a cluster randomised controlled trial among seven pairs of primary healthcare clinics in rural South Africa, comparing on-site testing complemented by laboratory confirmation versus laboratory testing alone. Intervention clinics used the on-site test conducted by primary care nurses, with results and treatment available within an hour. Control clinics sent blood samples to the provincial laboratory, with results returned 2 weeks later. Results: Of 7134 women seeking antenatal care with available test results, 793 (11.1%) tested positive for syphilis. Women at intervention clinics completed treatment 16 days sooner on average (95% confidence interval: 11 to 21), though there was no significant difference in the proportion receiving adequate treatment at intervention (64%) and control (69%) clinics. There was also no significant difference in the proportion experiencing perinatal loss (3.3% v 5.1%; adjusted risk difference: -0.9%; 95% CI -4.4 to 2.7). Conclusions: Despite reducing treatment delays, the addition of on-site syphilis testing to existing laboratory testing services did not lead to higher treatment rates or reduce perinatal mortality. However on-site testing for syphilis may remain an important option for improving antenatal care in settings where laboratory facilities are not available.