Background: HIV retesting during late pregnancy and breastfeeding can help detect new maternal infections and prevent mother-to-child HIV transmission (MTCT), but the optimal timing and cost-effectiveness of maternal retesting is uncertain. Methods: We constructed Markov models to assess the health and economic impact of maternal HIV retesting, following initial testing in pregnancy, on MTCT in four countries: South Africa and Kenya (high/intermediate HIV prevalence), and Colombia and Ukraine (low HIV prevalence). We evaluated six scenarios with varying retesting frequencies from the second antenatal care visit (ANC) through nine months postpartum. We compared strategies using incremental cost-effectiveness ratios (ICERs) over a 20-year time horizon using country-specific thresholds. Findings: Maternal retesting once at second ANC with catch-up testing through six weeks postpartum was cost-effective in Kenya (ICER=$166 per DALY averted) and South Africa (ICER=$289 per DALY averted). This strategy prevented 19% (Kenya) and 12% (South Africa) of infant HIV infections. Adding one or two additional retests postpartum provided smaller benefits (1-2% additional infections averted versus one retest). Adding three retests during the postpartum period averted additional infections (1-3% additional infections averted versus one retest) but ICERs ($7,639 and in Kenya and $11,985 in South Africa) greatly exceeded the cost-effectiveness thresholds. In Colombia and Ukraine, all retesting strategies exceeded the cost-effectiveness threshold and prevented few infant infections (up to 31 and 5 infections, respectively). Interpretation: In high HIV burden settings, HIV retesting once at second ANC, with subsequent intervention, is the most cost-effective strategy for preventing infant HIV infections. In these settings, two HIV retests postpartum marginally reduced MTCT and was less costly than adding three retests. Retesting in Colombia and Ukraine was not cost-effective at any time point due to very low HIV prevalence and limited breastfeeding. Funding: This study was funded by WHO #201742717, WHO #018/CDS/HIV/004, WHO #2018/865307-0, USAID GHA‐G‐ 00‐09‐00003, and the Bill and Melinda Gates Foundation OPP1177903, and supported by NIH/NIAID P30‐ AI027757, NIH/NIAID K01 AI116298 (ALD), NIH/NIMH K01 MH115789 (MS) and NIH/NIEHS T32 ES015459-09 (JM). Declaration of Interests: The authors declare no competing interests. Ethics Approval Statement: Missing.