Internet communication technologies have fostered the rapid emergence of virtual communities. Knowledge sharing among participants has become critical for attracting and retaining users of these virtual communities. Previous researchers have highlighted the contextual and individual factors affecting knowledge sharing. However, little research has examined how knowledge sharing influences e-loyalty. The purpose of this paper is to investigate the relationships among social capital, knowledge sharing, team learning and e-loyalty in virtual communities. Based on a field survey of 222 virtual community members, we found that social capital is positively related to their team learning and knowledge sharing in the community, while team learning is positively related to knowledge sharing. Particularly, social capital and knowledge sharing are both positively related to members’ e-loyalty. Finally, the theoretical and practical implications of these findings are discussed.