The new coronavirus, known as COVID-19, first emerged in Wuhan, China, and since then has been transmitted to the whole world. Around 34 million people have been infected with COVID-19 virus so far, and nearly 1 million have died as a result of the virus. Resource shortages such as test kits and ventilator have arisen in many countries as the number of cases have increased beyond the control. Therefore, it has become very important to develop deep learning-based applications that automatically detect COVID-19 cases using chest X-ray images to assist specialists and radiologists in diagnosis. In this study, we propose a new approach based on deep LSTM model to automatically identify COVID-19 cases from X-ray images. Contrary to the transfer learning and deep feature extraction approaches, the deep LSTM model is an architecture, which is learned from scratch. Besides, the Sobel gradient and marker-controlled watershed segmentation operations are applied to raw images for increasing the performance of proposed model in the pre-processing stage. The experimental studies were performed on a combined public dataset constituted by gathering COVID-19, pneumonia and normal (healthy) chest X-ray images. The dataset was randomly separated into two sections as training and testing data. For training and testing, these separations were performed with the rates of 80%–20%, 70%–30% and 60%–40%, respectively. The best performance was achieved with 80% training and 20% testing rate. Moreover, the success rate was 100% for all performance criteria, which composed of accuracy, sensitivity, specificity and F-score. Consequently, the proposed model with pre-processing images ensured promising results on a small dataset compared to big data. Generally, the proposed model can significantly improve the present radiology based approaches and it can be very useful application for radiologists and specialists to help them in detection, quantity determination and tracing of COVID-19 cases throughout the pandemic.