With the proliferation of portable computing platforms and small wireless devices, the classical dilemma of leader election in mobile ad hoc networks has received attention from the research community in recent years. The problem aims to elect a unique leader among mobile nodes regardless of their physical locations. But, existing distributed leader election algorithms do not cope with highly spontaneous nature of mobile ad hoc networks. This paper presents a consensus-based leader election algorithm that finds a local extrema among the nodes participating in leader election. The algorithm is highly adaptive with ad hoc networks in the sense that it can tolerate intermittent failures, such as link failures, sudden crash or recovery of mobile nodes, network partitions, and merging of connected network components associated with ad hoc networks. The paper also presents proofs of correctness to exhibit the fairness of this algorithm.