Due to abundant spectral information contained in the hyperspectral images, they are suitable data for anomalous targets detection. The use of spatial features in addition to spectral ones can improve the anomaly detection performance. An anomaly detector, called nonparametric spectral-spatial detector (NSSD), is proposed in this work which utilizes the benefits of spatial features and local structures extracted by the morphological filters. The obtained spectral-spatial hypercube has high dimensionality. So, accurate estimates of the background statistics in small local windows may not be obtained. Applying conventional detectors such as Local Reed Xiaoli (RX) to the high dimensional data is not possible. To deal with this difficulty, a nonparametric distance, without any need to estimate the data statistics, is used instead of the Mahalanobis distance. According to the experimental results, the detection accuracy improvement of the proposed NSSD method compared to Global RX, Local RX, weighted RX, linear filtering based RX (LF-RX), background joint sparse representation detection (BJSRD), Kernel RX, subspace RX (SSRX) and RX and uniform target detector (RX-UTD) in average is 47.68%, 27.86%, 13.23%, 29.26%, 3.33%, 17.07%, 15.88%, and 44.25%, respectively.