There is a growing trend in early detection and diagnosis of COVID-19 for effective and accurate treatment. Several specialized studies have been conducted to develop programs that help in accurate diagnosis and reduce the burden on experts and specialists in this field. This paper describes an automated detection method for COVID-19 using deep learning techniques and computerized tomography images of the chest region. The images were initially optimized as a first step, and then a diagnostic process was performed to determine whether the lung had pneumonia, COVID-19, or healthy using the CNN algorithm. In addition to diagnosing the infection, the lung area was subsequently separated from the CT images for use in performing the final stage of determination of the ratio of COVID-19 infection in the lung and classified according to the ratio of infection rate to three stages (mild, moderate, severe). It is worth mentioning that the proposed system was trained on a database that contained 10,000 images of COVID-19, 10,000 pneumonia, and 10,000 healthy lungs. The proposed system diagnosed COVID-19 with an accuracy of 99.7 and an F1 score of 99.7.