In clustering algorithm of wireless sensor networks, to solve the problem of excessive energy consumption in the cluster heads with multilevel energies, an improved reactive three level heterogeneous stable election protocol is proposed by combining the reactive routing mechanism and multilevel heterogeneous networks. In cluster heads election phase of every round, the algorithm considers the residual energy and higher initial energy of all nodes to elect an optimal cluster head. Furthermore, reactive routing mechanism is employed here to minimize the number of nodes transmitting data to the cluster heads. Simulation results show that the improved routing protocol has better performance in the network life cycle and network energy consumption than SEP, SEP-E and ESEP-E protocol respectively such that it is more suitable for dealing with the problem of multilevel energy heterogeneous sensor network.