BACKGROUND: Women with unexplained infertility are often offered intrauterine insemination (IUI) with ovarian stimulation as an alternative to in-vitro fertilisation (IVF). However, little evidence exists that IUI is an effective treatment. In 2013, the UK National Institute for Health and Care Excellence recommended that IUI should not be routinely offered for couples with unexplained infertility.METHODS: For this pragmatic, open-label, randomised, controlled, two-centre study, we enrolled women attending two fertility clinics in New Zealand with unexplained infertility and an unfavourable prognosis of natural conception. Participants were randomly assigned (1:1) using a computer-generated randomisation sequence, prepared by an independent statistician, to either three cycles of IUI with ovarian stimulation (with either oral clomifene citrate [50-150 mg, days 2-6] or oral letrozole [2·5-7·5 mg, days 2-6], with choice of ovarian stimulation made by the clinic) or three cycles of expectant management (couples advised to be sexually active around the likely time of ovulation and provided with a diary to record the first day of each menstrual cycle and dates of sexual activity) in blocks of four, six, and ten, without stratification. The participating couple and the clinicians were informed of treatment allocation. The primary outcome was cumulative livebirth rate in the intention-to-treat population. The safety analyses were done in the intention-to-treat population. This study was prospectively registered with the Australian and New Zealand Clinical Trials Register, number ACTRN12612001025820.FINDINGS: Between March 12, 2013, and May 12, 2016, we randomly assigned 101 women to IUI with ovarian stimulation and 100 to expectant management, all of whom were included in the primary efficacy analysis and safety analyses. Women assigned to IUI had a higher cumulative livebirth rate than women assigned to expectant management (31 [31%] livebirths among 101 women vs nine [9%] livebirths among 100 women; risk ratio [RR] 3·41, 95% CI 1·71-6·79; p=0·0003). Of 31 livebirths in the IUI group, 23 resulted from IUI cycles and eight were conceived without assistance before or between IUI cycles. Of nine livebirths in the expectant management group, one patient was pregnant from IUI with ovarian stimulation at study entry and one had received off-protocol treatment (IVF). Two sets of twins were born, both in the IUI group (one from a cancelled cycle for over-response).INTERPRETATION: IUI with ovarian stimulation is a safe and effective treatment for women with unexplained infertility and an unfavourable prognosis for natural conception.FUNDING: Auckland Medical Research Foundation, Evelyn Bond Fund of Auckland District Health Board, Mercia Barnes Trust of Royal Australian and New Zealand College of Obstetricians and Gynaecologists, Maurice and Phyllis Paykel Trust, and The Nurture Foundation for Reproductive Research.