Oral iron for anaemia in pregnancy is often not well tolerated, with poor adherence. Iron administered intravenously might address these tolerance and adherence issues. We investigated the effectiveness and safety of intravenous ferric carboxymaltose versus oral ferrous sulphate on anaemia and iron deficiency among pregnant women in Nigeria. We did a multicentre, open-label, parallel, randomised controlled trial of pregnant women (aged 15-49 years) with haemoglobin (Hb) concentrations of less than 10 g/dL at 20-32 weeks' gestation from 11 primary, secondary, or tertiary health facilities in Nigeria (five in Lagos and six in Kano). Exclusion criteria included vaginal bleeding, blood transfusion or major surgery within the past 3 months, symptomatic anaemia, anaemia known to be unrelated to iron deficiency, clinically confirmed malabsorption syndrome, previous hypersensitivity to any form of iron, pre-existing maternal depression or other major psychiatric illness, immune-related diseases, such as systemic lupus erythematosus or rheumatoid arthritis, or severe allergic reactions. Participants were randomly assigned (1:1) by nurses and doctors using a web-based randomisation service to either receive a single dose of intravenous ferric carboxymaltose (20 mg/kg to a maximum of 1000 mg) or oral ferrous sulphate (200 mg; 65 mg elemental iron) three times daily until 6 weeks postpartum. The study was primarily unmasked. Primary outcomes were maternal anaemia (Hb <11 g/dL) at 36 weeks' gestation and preterm birth at before 37 weeks' gestation, with analysis by intention to treat in participants with available data. This study was registered at the ISRCTN registry on Dec 10, 2020 (ISRCTN63484804) and on ClinicalTrials.gov (NCT04976179) on April 7, 2021. Between Aug 10, 2021, and Dec 15, 2022, 13 724 pregnant women were screened for eligibility. 12 668 were excluded due to ineligibility for inclusion, and 1056 provided consent to participate and were randomly assigned to either the intravenous or oral administration groups. 527 were assigned to the intravenous ferric carboxymaltose group and 529 were assigned to the oral ferrous sulphate group. 518 in the intravenous group were assessed at 36 weeks' gestational age and after 518 deliveries, and 511 completed the 6 weeks postpartum visit. 513 in the oral ferrous sulphate group were assessed at 36 weeks' gestational age and after 512 deliveries, and 501 completed the 6 weeks postpartum visit. No significant difference was found in anaemia at 36 weeks (299 [58%] of 517 in the intravenous group vs 305 [61%] of 503 in the oral group; risk ratio 0·95, 95% CI 0·85-1·06; p=0·36), nor in preterm birth (73 [14%] of 518 vs 77 [15%] of 513; 0·94, 0·70-1·26; p=0·66). There were no significant differences in adverse events. The most common adverse events were diarrhoea (in six participants) and vomiting (in three participants) in the oral group and fatigue (in two participants) and headache (in two participants) in the intravenous group. Although the effect on overall anaemia did not differ, intravenous iron reduced the prevalence of iron deficiency to a greater extent than oral iron and was considered to be safe. We recommend that intravenous iron be considered for anaemic pregnant women in Nigeria and similar settings. Bill & Melinda Gates Foundation.