Jamming attack is a serious security threat in wireless sensor networks. Therefore, it is important to frame a mechanism to protect wireless sensor networks from various jamming attacks. Jammer intrusion detection and jamming detection are two separate issues. In this paper, a novel jammer detection framework to detect the intrusion of jammer and the presence of jamming in a cluster-based wireless sensor network is proposed. The proposed framework is novel in three aspects: whenever the cluster head receives a packet, it first verifies whether the source node is a legitimate, new node, or a jammer node. Second, when the source node is declared as a new one in the first step, then the framework validates whether the new node is legitimate node in the previous cluster or a jammer node by using cluster head code. Third, the framework observes the behavior of the newly joined node and the existing nodes to identify whether the nodes in the cluster is jammed or not. Additionally, it also classifies the types of jamming, if the presence of jamming is detected. Simulation result shows that the proposed framework performs extremely well and achieves jamming detection rate as high as 99.88 %. © 2016, Perumal et al.