In wireless sensor networks (WSNs), sensor devices have limited supply of energy. The sensor death due to dissipating battery energy is one of the fundamental design issues in WSNs. Hence, energy efficiency is argued to be the most important requirement for any protocol designed for WSNs. With sensors acting as routers to transport the packets from a source to a destination sensor, multipath protocols are used to discover multiple paths with the objective to improve the reliability, efficiency, and security in WSNs. Selecting the path that minimizes the rate of sensors death and extends the lifetime of the network is the main challenge for multipath protocols. In this paper, we propose a new energy and security aware route selection (ESARS) protocol for WSNs. The first part of ESARS selects a route that maximizes the network lifetime based on a novel metric. The second part of ESARS finds the optimal security level for the selected path based on the estimated security risk of the path. Traditionally, these two parts are addressed separately in the literature, and this paper combines the two parts in one protocol. The proposed protocol is evaluated and compared with other protocols using both analytical analysis and extensive simulations. The results show that the proposed protocol not only achieves its main objective to extend the network lifetime by significantly reducing the sensors death rate but also uses the most optimal security level for the selected route. Moreover, in ESARS protocol, several threshold parameters were employed to provide flexibility per the needs of the application in which the sensors are used. Copyright © 2013 John Wiley & Sons, Ltd.