This study examines the effect of two potential sources of ethical principles on earnings quality: corporate social responsibility (CSR) and membership in a Shariah index. We define membership in a Shariah index as the adherence to an ethical code that relates to Islam. Our sample comprises firms in ten European Union countries for the period from 2003 to 2013. The empirical results show that firms with a high degree of CSR are less likely to manage earnings. In contrast, membership in a Shariah index leads to earnings manipulation. Our results are robust after using several alternative quality metrics for earnings. Furthermore, our empirical results indicate that highly rated CSR firms that are not Shariah-compliant are less likely to engage in earnings manipulation. Further, institutional factors are also important in determining the link between CSR, Shariah-compliance, and the quality of financial reporting.