The Hyperspectral remote sensing technology has many applications in classifying land covers and studying their changes. With recent developments and the creation of images with high spatial resolution, the simultaneous use of spectral and spatial information in the classification of hyperspectral images is necessary. In this research, a new method for the classification of hyperspectral images is introduced with the help of dimensionality reduction techniques and spatial feature extraction and neural network algorithm. In the proposed method, first, the dimensions of the hyperspectral image are reduced with the help of the principal components analysis algorithm. Then ten spatial features, mean, standard deviation, contrast, homogeneity, correlation, dissimilarity, energy, entropy, wavelet transform and Gabor filter, are extracted and then the weighted genetic algorithm is applied on the spectral and spatial features obtained. In the weighted genetic algorithm, according to the information available in the features, it gives them a weight between zero and one. Finally, a multilayer perceptron neural network classification algorithm was applied to the existing features. The proposed method was implemented on two hyperspectral images of Pavia and Berlin. The results of the obtained experiments show the superiority of the proposed method compared to the support vector machines, multilayer perceptron neural network and minimum spanning forest classification methods. This increase is about 13, 6, and 5% for the Pavia image and about 8, 6, and 5% for the Berlin image in the overall accuracy parameter and in comparison with the mentioned methods, respectively.