Hyperspectral sensors collect hundreds of images in contiguous and narrowly spaced spectral bands. They have the potential to simultaneously provide high spatial and spectral resolution of targets of interest in Automatic Target Detection and Recognition (ATD/R). The price to be paid is the need to process and store an extremely large amount of data in an effective and timely manner. We develop a new implementation of the maximum-likelihood (ML) detector which is both practical and efficient. Our detection is based on a Gauss- Markov Random Field (GMRF) model for the data which avoids the inversion of large data covariance matrices usually encountered in ML-detectors. The paper presents two algorithms to fit the GMRF to the hyperspectral sensor data: an optimal ML estimation algorithm and a suboptimal Least Squares (LS) estimation algorithm. Using the LS-algorithm, we develop the structure of the detector and present estimation results from a real hyperspectral data set.