Wireless Sensor Networks (WSNs) have been around for over a decade and have been used in many important applications. Energy and reliability are two of the major problems with these kinds of applications. Reliable data delivery is an important issue in WSNs because it is a key part of how well data are sent. At the same time, energy consumption in battery-based sensors is another challenge. Therefore, efficient clustering and routing are techniques that can be used to save sensors energy and guarantee reliable message delivery. With this in mind, this paper develops an energy-efficient and reliable clustering protocol (ERCP) for WSNs. First, an efficient clustering technique is proposed for sensor nodes' energy savings considering different clustering parameters, including the link quality metric, the energy, the distance to neighbors, the distance to the sink node, and the cluster load metric. The proposed routing protocol works based on the concept of a reliable inter-cluster routing technique that saves energy. The routing decisions are made based on different parameters, such as the energy balance metric, the distance to the sink node, and the wireless link quality. Many experiments and analyses are examined to determine how well the ERCP performs. The experiment results showed that the ECRP protocol performs much better than some of the recent algorithms in both homogeneous and heterogeneous networks.