The tragic West African Ebola epidemic claimed many lives, but would have been worse still if scientific insights from many disciplines had not been integrated to create a strong technical response. Epidemiology and modelling triggered the international response and guided where response efforts were directed; virology, engineering and clinical science helped reduce deaths and transmission in and from hospitals and treatment centres; social sciences were key to reducing deaths from funerals and in the community; diagnostic and operational research made the response more efficient; immunology and vaccine research contributed to the final stages of the epidemic and will help prevent future epidemics. These varied scientific contributions had to be integrated into a combined narrative, communicated to policymakers to inform decisions, and used by courageous local and international responders in the field in real time. Not every area of science was optimal, and in particular, clinical trials of simple interventions such as fluid management were slow to be adopted and sharing of data was initially poor. This Ebola epidemic demonstrated how science can respond to a major emergency, but also has lessons for better responses in future infectious emergencies. This article is part of the themed issue 'The 2013-2016 West African Ebola epidemic: data, decision-making and disease control'.