Magnetic resonance imaging (MRI) is a high-quality medical image that is used to detect brain tumours in a complex and time-consuming manner. In this study, a back propagation neural network (BPNN) along with the Levenberg-Marquardt algorithm (LMA) is proposed to classify MRIs and diagnose brain tumours in a simple and fast process. The BPNN has 10 neurons in the hidden layer, and the default function of the feedforward feeds is mean squared error (MSE). The LMA is optimized as a multivariable adaptive approach and considerably decreases the MSE of the BPNN, so the errors of the tumour classification are diminished. The proposed method follows four steps including preprocessing, skull removal, feature extraction, and classification. The input MRIs are converted to greyscale, resized, and thresholding is performed in the preprocessing step and followed by skull removal. Morphological operations of closing, opening, and dilation are used to segment abnormal areas in the MRIs, and the opening operator recognizes the tumour more accurately. Using statistical analysis and a grey-level co-occurrence matrix (GLCM) 12 features are extracted from the MRIs and used as the inputs of the BPNN. To evaluate the proposed method, 670 normal and 670 abnormal brain MRIs are used as input data, and the classification is performed in 0.494 s. The accuracy, sensitivity, specificity, precision, dice, recall, and MSE are 98.7%, 97.61%, 99.7%, 97.61%, 98.6%, 97.61%, and 0.005, respectively. The approach is accurate and fast for medical images classification.