Research is a key determinant of health improvement. However, there is little empirical evidence showing how the research conducted in hospitals affects healthcare outcomes. To address this issue, we used panel data of 189 Spanish public hospitals over the period 1996–2009 to estimate the causal effect of both clinical and basic research on hospitals’ efficiency, measuring their impact on the average length of stay (LOS). We considered two fixed effects econometric models; one for medical and the other for surgical specialties respectively. Our results show that increases in the quantity of research produced in medical (surgical) disciplines contribute significantly to the reduction of hospital LOS in medical (surgical) specialties. This effect is greater for hospitals with higher absorptive capacity. There is also clear evidence that basic research produces efficiency gains in clinical outcomes. Furthermore, we have identified other important determinants of hospitals’ efficiency namely, hospitals’ characteristics, human resources, diagnostic activity, hospital investment and hospitals’ absorptive capacity. We evaluated the economic impact of increases in medical, surgical R&D.