© 2014 Wolters Kluwer Health & Lippincott Williams & Wilkins. Objective: Many sub-Saharan African countries report high postpartum loss to followup of mother-baby pairs. We aimed to determine whether interactive text messages improved rates of clinic attendance and early infant HIV testing in the Nyanza region of Kenya. Design: Parallel-group, unblinded, randomized controlled trial. Methods: HIV-positive pregnant women at least 18 years old and enrolled in the prevention of mother-to-child transmission of HIV programme were randomized to receive either text messages (SMS group, n=195) or usual care (n=193). Messages were developed using formative focus group research informed by constructs of the Health Belief Model. The SMS group received up to eight text messages before delivery (depending on gestational age), and six messages postpartum. Primary outcomes included maternal postpartum clinic attendance and virological infant HIV testing by 8 weeks postpartum. The primary analyses were intention-to-treat. Results: Of the 388 enrolled women, 381 (98.2%) had final outcome information. In the SMS group, 38 of 194 (19.6%) women attended a maternal postpartum clinic compared to 22 of 187 (11.8%) in the control group (relative risk 1.66, 95% confidence interval 1.02-2.70). HIV testing within 8 weeks was performed in 172 of 187 (92.0%) infants in the SMS group compared to 154 of 181 (85.1%) in the control group (relative risk 1.08, 95% confidence interval 1.00-1.16). Conclusions: Text messaging significantly improved maternal postpartum visit attendance, but overall return rates for these visits remained low. In contrast, high rates of early infant HIV testing were achieved in both arms, with significantly higher testing rates in the SMS compared to the control infants.