Agile software development has caught the attention of both practitioners and academics in recent years. In spite of many anecdotes and papers describing lessons learnt the theoretical foundation of agile software development has not been systematically articulated. This paper proposes a conceptual framework to study agile software development based on the theory of complex adaptive systems. The framework is illustrated by a case study of an agile software development team. Several agile practices are identified and reflected on from the perspective of complex adaptive systems.