Localization is a fundamental problem in wireless sensor networks and its accuracy impacts the efficiency of location-aware protocols and applications, such as routing and storage. Most previous localization algorithms assume that sensors are distributed in regular areas without holes or obstacles, which often does not reflect real-world conditions, especially for outdoor deployment of wireless sensor networks. In this paper, we propose a novel scheme called Reliable Anchor-based Localization (RAL), which can greatly reduce the localization error due to the irregular deployment areas. We first provide theoretical analysis of the minimum hop length for uniformly distributed networks and then show its close approximation to empirical results, which can assist in the construction of a reliable minimal hop-length table offline. Using this table, we are able to tell whether a path is severely detoured and compute a more accurate average hop length as the basis for distance estimation. At runtime, the RAL scheme 1) utilizes the reliable minimal hop length from the table as the threshold to differentiate between reliable anchors and unreliable ones, and 2) allows each sensor to determine its position utilizing only distance constraints obtained from reliable anchors. The simulation results show that RAL can effectively filter out unreliable anchors and therefore improve the localization accuracy. © 2006 IEEE.