In order to prolong the lifetime of wireless sensor networks, this paper presents a multihop routing protocol with unequal clustering (MRPUC). On the one hand, cluster heads deliver the data to the base station with relay to reduce energy consumption. On the other hand, MRPUC uses many measures to balance the energy of nodes. First, it selects the nodes with more residual energy as cluster heads, and clusters closer to the base station have smaller sizes to preserve some energy during intra-cluster communication for inter-cluster packets forwarding. Second, when regular nodes join clusters, they consider not only the distance to cluster heads but also the residual energy of cluster heads. Third, cluster heads choose those nodes as relay nodes, which have minimum energy consumption for forwarding and maximum residual energy to avoid dying earlier. Simulation results show that MRPUC performs much better than similar protocols.