This document presents a novel energy-aware node clustering algorithm for wireless sensor networks using a modified artificial fish swarm algorithm (AFSA). The proposed algorithm improves the standard AFSA by increasing the balance between local and global searches, and adding a new mechanism to improve convergence speed for clustering problems. The performance of the proposed algorithm is evaluated and compared to several state-of-the-art clustering techniques, showing that it outperforms them by prolonging the lifetime of the wireless sensor network. The algorithm models sensor nodes as artificial fish that perform behaviors like prey, free-move, swarm, and follow to iteratively cluster the nodes in an energy-efficient manner.