<span>Electroencephalography (EEG) is a widely used and significant technique for aiding in epilepsy diagnosis and investigating the electrical patterns of the human brain. Due to the non-stationary nature of EEG signals, seizure patterns will vary across different recording sessions for individual patients. In this study, a new deep learning long short-term memory (LSTM) model is implemented for the detection of brain tumors and seizures. The process consists of four key steps: EEG signal pre-processing, preictal feature extraction, hyper optimization using grey wolf optimization (GWO), and LSTM-based classification. The evaluation makes use of long-term EEG recordings from the EEG and ABIDE fMRI datasets. By experimenting with various modules and layers of memory units, a pre-analysis is first conducted to determine the best LSTM network architecture. The LSTM model makes use of numerous retrieved features, including temporal and frequency domain information between EEG channels that were extracted before classification. The discovery of the implemented methodology revealed significant advantages in accurately predicting seizures while minimizing false alarms. The implemented LSTM method achieves a 99% accuracy rate, 98% precision, 99% recall, and 98% f1-measure which is better when compared with cross sub-pattern correlation-based principal component analysis (SUBXPCA) and gradient-boosting decision tree (GBDT) methods.</span>