Cardiotocography (CTG), which measures the fetal heart rate (FHR) and maternal uterine contractions (UC) simultaneously, is used for monitoring fetal well-being during delivery or antenatally at the third trimester. Baseline FHR and its response to uterine contractions can be used to diagnose fetal distress, which may necessitate therapeutic intervention. In this study, a machine learning model based on feature extraction (autoencoder), feature selection (recursive feature elimination), and Bayesian optimization, was proposed to diagnose and classify the different conditions of fetuses (Normal, Suspect, Pathologic) along with the CTG morphological patterns. The model was evaluated on a publicly available CTG dataset. This research also addressed the imbalance nature of the CTG dataset. The proposed model has a potential application as a decision support tool to manage pregnancies. The proposed model resulted in good performance analysis metrics. Using this model with Random Forest resulted in a model accuracy of 96.62% for fetal status classification and 94.96% for CTG morphological pattern classification. In rational terms, the model was able to accurately predict 98% Suspect cases and 98.6% Pathologic cases in the dataset. The combination of predicting and classifying fetal status as well as the CTG morphological patterns shows potential in monitoring high-risk pregnancies.