Measuring and identifying the specific level of sustained attention during continuous tasks is essential in many applications, especially for avoiding the terrible consequences caused by reduced attention of people with special tasks. To this end, we recorded EEG signals from 42 subjects during the performance of a sustained attention task and obtained resting state and three levels of attentional states using the calibrated response time. EEG-based dynamical complexity features and Extreme Gradient Boosting (XGBoost) classifier were proposed as the classification model, Complexity-XGBoost, to distinguish multi-level attention states with improved accuracy. The maximum average accuracy of Complexity-XGBoost were 81.39 ± 1.47% for four attention levels, 80.42 ± 0.84% for three attention levels, and 95.36 ± 2.31% for two attention levels in 5-fold cross-validation. The proposed method is compared with other models of traditional EEG features and different classification algorithms, the results confirmed the effectiveness of the proposed method. We also found that the frontal EEG dynamical complexity measures were related to the changing process of response during sustained attention task. The proposed dynamical complexity approach could be helpful to recognize attention status during important tasks to improve safety and efficiency, and be useful for further brain-computer interaction research in clinical research or daily practice, such as the cognitive assessment or neural feedback treatment of individuals with attention deficit hyperactivity disorders, Alzheimer’s disease, and other diseases which affect the sustained attention function.