In wireless sensor networks, it is common that adversaries capture some nodes to intercept, tamper, or drop valuable packages. We can employ reputation systems to identify the compromised nodes (CNs). In this paper, the areas that cover a set of dense CNs are called compromised regions (CRs) and apparently, they are a greater threat to the networks than single CNs. To defend against the attack of CRs, we design a secure shortest path routing algorithm (SPRA) to deliver packages properly around, rather than through, the CRs. Specifically, a source node first computes the shortest geometric path to the sink node without crossing any CRs and then decides agent nodes along with the path by a set of virtual locations in an indirect way. At last, a sophisticated mechanism is designed based on geographic information to guarantee that the packages can be delivered in a relay manner between the agent nodes until they are transmitted to the sink node successfully. We conduct a series of experiments to compare our scheme with the dynamic greedy perimeter stateless routing and directed diffusion algorithms. The simulation results illustrate that SPRA can always find the short routing paths while guaranteeing the security of the packages. INDEX TERMS Wireless sensor networks, secure routing, compromised regions, energy-efficiency.