In this paper we present a nonlinear version of the wellknown anomaly detection method referred to as the RXalgorithm. Extending this algorithm to a feature space associated with the original input space via a certain nonlinear mapping function can provide a nonlinear version of the RX-algorithm. This nonlinear RX-algorithm, referred to as the kernel RX-algorithm, is basically intractable mainly due to the high dimensionality of the feature space produced by the non-linear mapping function. However, in this paper it is shown that the kernel RX-algorithm can easily be implemented by kernelizing it in terms of kernels which implicitly compute dot products in the feature space. Improved performance of the kernel RX-algorithm over the conventional RX-algorithm is shown by testing several hyperspectral imagery for military target and mine detection.