Prediction of carbon dioxide (CO2) emissions is a critical step towards a sustainable environment. In any country, increasing the amount of CO2 emissions is an indicator of the increase in environmental pollution. In this regard, the current study applied three powerful and effective artificial intelligence tools, namely, a feed-forward neural network (FFNN), an adaptive network-based fuzzy inference system (ANFIS) and long short-term memory (LSTM), to forecast the yearly amount of CO2 emissions in Saudi Arabia up to the year 2030. The data were collected from the “Our World in Data” website, which offers the measurements of the CO2 emissions from the years 1936 to 2020 for every country on the globe. However, this study is only concerned with the data related to Saudi Arabia. Due to some missing data, this study considered only the measurements in the years from 1954 to 2020. The 67 data samples were divided into 2 subsets for training and testing with the optimal ratio of 70:30, respectively. The effect of different input combinations on prediction accuracy was also studied. The inputs were combined to form six different groups to predict the next value of the CO2 emissions from the past values. The group of inputs that contained the past value in addition to the year as a temporal index was found to be the best one. For all the models, the performance accuracies were assessed using the root mean squared errors (RMSEs) and the coefficient of determination (R2). Every model was trained until the smallest RMSE of the testing data was reached throughout the entire training run. For the FFNN, ANFIS and LSTM, the averages of the RMSEs were 19.78, 20.89505 and 15.42295, respectively, while the averages of the R2 were found to be 0.990985, 0.98875 and 0.9945, respectively. Every model was applied individually to forecast the next value of the CO2 emission. To benefit from the powers of the three artificial intelligence (AI) tools, the final forecasted value was considered the average (ensemble) value of the three models’ outputs. To assess the forecasting accuracy, the ensemble was validated with a new measurement for the year 2021, and the calculated percentage error was found to be 6.8675% with an accuracy of 93.1325%, which implies that the model is highly accurate. Moreover, the resulting forecasting curve of the ensembled models showed that the rate of CO2 emissions in Saudi Arabia is expected to decrease from 9.4976 million tonnes per year based on the period 1954–2020 to 6.1707 million tonnes per year in the period 2020–2030. Therefore, the finding of this work could possibly help the policymakers in Saudi Arabia to take the correct and wise decisions regarding this issue not only for the near future but also for the far future.