COVID-19 detection through radiological examination is favoured since it is fast and produces more accurate results than the laboratory approach. However, when it has infected many people and put a strain on the healthcare system, the need for fast, automatic COVID-19 detection in patients has become critical. This study proposes to detect COVID-19 from chest X-ray (CXR) images with a machine learning approach. The main contributions of this paper are to compare two powerful deep learning models, i.e., convolutional neural networks (CNN) and the combination of CNN and Long Short-Term Memory (LSTM). In the combination model, CNN is recommended for feature extraction, and COVID-19 is classified using the features of LSTM. The dataset used in this study amounted to 4,095 CXR images, consisting of 1,400 images of normal conditions, 1,350 images of COVID-19, and 1,345 images of pneumonia. Both CNN and CNN-LSTM were executed in a similar experimental setup and evaluated using a confusion matrix. The experiment results provide evidence that the CNN-LTSM is better than the CNN deep learning model, with an overall accuracy of about 98.78%. Furthermore, it has a precision and recall of 99% and 98%, respectively. These findings will be valuable in the fast and accurate detection of COVID-19.