The demand for better intrusion detection systems, especially anomaly intrusion detection, increases daily, as new attacks arise and Internet speeds increase. The criterion for a good intrusion detection system is to detect emerging attacks with high accuracy at line rates. Existing systems suffer from high false positives and negatives, and are unable to handle increasing traffic rates. This paper applies artificial bee colony for anomaly-based intrusion detection systems. In addition, it uses two feature selection techniques to reduce the amount of data used for detection and classification. KDD Cup 99 dataset was used to evaluate the proposed algorithm. Experimental results show that artificial bee colony achieves average accuracy rate of 97.5% for known attacks and 93.2% overall for known and unknown attacks. The new algorithm outperforms all methods reported in the literature. Copyright © 2012 John Wiley & Sons, Ltd.