Purpose – The purpose of this study is to investigate the influential factors of customer loyalty to Islamic banks, namely, service quality, customer satisfaction, customer engagement and religiosity. Design/methodology/approach – This study is a survey of 335 Islamic bank customers in West Sumatra, Indonesia. This research deployed purposive sampling and analyzed the data by using covariance based structural equation modeling.Findings – Service quality has a positive and significant impact on customer satisfaction. Religiosity has a significant and negative moderating impact on the service quality–customer satisfaction relationship. Service quality has no significant influence on customer loyalty. Customer satisfaction is a significant antecedent of customer engagement and loyalty. Finally, customer engagement has a significant and positive effect on customer loyalty.Research limitations/implications – This study is a combination of cross-sectional and a single country case. Accordingly, the results may not be representative of other countries. Similar studies in longitudinal data collection are conducted in other countries (e.g. ASEAN countries), which would therefore be worthwhile. Some antecedents of customer loyalty have been neglected in this study (e.g. customer value co-creation and customer commitment); hence, the future study may investigate those factors.Practical implications – By considering these Islamic banks’ antecedents, the Islamic banks might enhance their customer loyalty. Also, this study has revealed the moderating role of religiosity in a loyalty relationship. Therefore, it will give insights for the Islamic bank managers in decision-making.Originality/value – This study has revealed the moderating role of religiosity on the link between service quality and customer satisfaction in Islamic banks, which is, to the authors’ knowledge, neglected in the previous studies. The customers with high religiosity will have a higher standard of satisfaction and demand a better service quality than the customers with low religiosity. This study has also examined the relationships between service quality, religiosity, customer satisfaction, customer engagement and loyalty as a whole, which have been limited previously.