Recent studies show that hyperspectral image classification techniques that use both spectral and spatial information are more suitable, effective, and robust than those that use only spectral information. Using a spatial-contextual term, this study modifies the decision function and constraints of a support vector machine (SVM) and proposes two kinds of spatial-contextual SVMs for hyperspectral image classification. One machine, which is based on the concept of Markov random fields (MRFs), uses the spatial information in the original space (SCSVM). The other machine uses the spatial information in the feature space (SCSVMF), i.e., the nearest neighbors in the feature space. The SCSVM is better able to classify pixels of different class labels with similar spectral values and deal with data that have no clear numerical interpretation. To evaluate the effectiveness of SCSVM, the experiments in this study compare the performances of other classifiers: an SVM, a context-sensitive semisupervised SVM, a maximum likelihood (ML) classifier, a Bayesian contextual classifier based on MRFs (ML_MRF), and nearest neighbor classifier. Experimental results show that the proposed method achieves good classification performance on famous hyperspectral images (the Indian Pine site (IPS) and the Washington, DC mall data sets). The overall classification accuracy of the hyperspectral image of the IPS data set with 16 classes is 95.5%. The kappa accuracy is up to 94.9%, and the average accuracy of each class is up to 94.2%.