In this study, we introduce a novel residual-based Bayesian expectation–maximization adaptive Kalman filter (RBEMAKF) for dynamic state estimation with inaccurate and time-varying noise covariance matrices. The proposed scheme presents a novel maximum a-posteriori (MAP) estimator for characterizing process and measurement noises, leveraging the residual information derived from the Kalman filter. Simultaneously, the MAP is addressed through the application of the expectation–maximization (EM) algorithm. Subsequently, the standard Kalman filter is executed based on the estimated posterior of process and measurement noises (PMNs) to correct the dynamic state in real-time. Additionally, RBEMAKF is extended to propose Laplacian-RBEMAKF (L-RBEMAKF) and Student’s t-RBEMAKF (ST-RBEMAKF) to accommodate outlier environments. These methods assume Laplacian and Student’s t distributions for the prior of PMNs in RBEMAKF, respectively. Extensive simulations and real-world results demonstrate the effectiveness of the proposed RBEMAKF and its extensions (L-RBEMAKF and ST-RBEMAKF) in dynamic state estimation. The availability of our codes can be found at https://github.com/Gaitxh/RBEMAKF.