Background: Despite the availability of continuous conventional electroencephalography (cEEG), accurate diagnosis of neonatal seizures is challenging in clinical practice. Algorithms for decision support in the recognition of neonatal seizures could improve detection. We aimed to assess the diagnostic accuracy of an automated seizure detection algorithm called Algorithm for Neonatal Seizure Recognition (ANSeR).Methods This multicentre, randomised, two-arm, parallel, controlled trial was done in eight neonatal centres across Ireland, the Netherlands, Sweden, and the UK. Neonates with a corrected gestational age between 36 and 44 weeks with, or at significant risk of, seizures requiring EEG monitoring, received cEEG plus ANSeR linked to the EEG monitor displaying a seizure probability trend in real time (algorithm group) or cEEG monitoring alone (non algorithm group). The primary outcome was diagnostic accuracy (sensitivity, specificity, and false detection rate) of health-care professionals to identify neonates with electrographic seizures and seizure hours with and without the support of the ANSeR algorithm. Neonates with data on the outcome of interest were included in the analysis. This study is registered with ClinicalTrials.gov, NCT02431780.Findings Between Feb 13, 2015, and Feb 7, 2017, 132 neonates were randomly assigned to the algorithm group and 132 to the non-algorithm group. Six neonates were excluded (four from the algorithm group and two from the non-algorithm group). Electrographic seizures were present in 32 (25.0%) of 128 neonates in the algorithm group and 38 (29.2%) of 130 neonates in the non-algorithm group. For recognition of neonates with electrographic seizures, sensitivity was 81.3% (95% CI 66.7-93.3) in the algorithm group and 89.5% (78.4-97.5) in the non-algorithm group; specificity was 84.4% (95% CI 76.9-91.0) in the algorithm group and 89.1% (82.5-94.7) in the non-algorithm group; and the false detection rate was 36.6% (95% CI 22.7-52.1) in the algorithm group and 22.7% (11.6-35.9) in the non-algorithm group. We identified 659 h in which seizures occurred (seizure hours): 268 h in the algorithm versus 391 h in the non algorithm group. The percentage of seizure hours correctly identified was higher in the algorithm group than in the non-algorithm group (177 [66.0%; 95% CI 53.8-77.3] of 268 h vs 177 [45.3%; 34.5-58.3] of 391 h; difference 20.8% [3.6-37.1]). No significant differences were seen in the percentage of neonates with seizures given at least one inappropriate antiseizure medication (37.5% [95% CI 25.0 to 56.3] vs 31.6% [21.1 to 47.4]; difference 5.9% [-14.0 to 26.3]).Interpretation ANSeR, a machine-learning algorithm, is safe and able to accurately detect neonatal seizures. Although the algorithm did not enhance identification of individual neonates with seizures beyond conventional EEG, recognition of seizure hours was improved with use of ANSeR. The benefit might be greater in less experienced centres, but further study is required.