In this paper, we address the problem of intrusion detection in wireless sensor networks (WSNs) using a learning automata (LA)-based approach. We are not aware of any LA-based intrusion detection systems (IDSs) for WSN. Additionally, the S-model approach that we have taken to solve the problem, wherein the feedback of the environment to the automaton can not only be completely favorable or completely unfavorable, but also be any continuous value within these extremities, makes it one of the attractive solution approaches in LA. We have rigorously evaluated the performance of our proposed solution by performing a variety of experiments and have found our solution approach to be promising. Copyright © 2008 John Wiley & Sons, Ltd.