Due to the recent increase in drilling operations complexity, the frequency of undesirable downhole events occurring while drilling a well is in ascend trend leading to substantial growth in non-productive time. Consequently, overall drilling costs become sky-high, a moment in which earlier and precise detection of the downhole drilling problems becomes a crucial factor in cost reduction. This paper presents an intelligent algorithm that can automatically analyze real-time drilling data and accurately detect and verify the presence of the most common downhole drilling problems upon their effective inception, which allows corrective measures to be applied at the appropriate time, resulting in a reduction of the negative impact and the associated cost of the detected downhole failure. The presented algorithm relies on constructing a risk predictive window by integrating a stochastic model with a data-driven model driven from real-time data of the surface and /or subsurface drilling parameters to detect the downhole problems. The process starts by building predictive models for predefined drilling parameters. Based on the natural distribution of the Residual Errors (REs) obtained while building the productive model, the best probability model that fits the REs data is picked. The statistical properties of the selective probabilistic models and the real-time predictive values of the predefined drilling parameters are used to generate multiple dimensional risk predictive windows; the indicated risk predictive window could have one or two dimensions, depending on the number of pre-built productive models. The downhole drilling problem is detected by observing and comparing the real-time measured value of the used drilling parameters with the risk predictive window; consecutive data points located outside the risk predictive window are considered abnormal. An alarm is triggered when the number of sequent outliers reaches a predetermined boundary. The developed algorithm was tested on a historical drilling dataset in which different downhole incidences occurred. The results show that the algorithm successfully detected all of the events at an average of 120 min before the officially recorded time.