Accurate and robust orientation estimation using magnetic and inertial measurement units (MIMUs) has been a challenge for many years in long-duration measurements of joint angles and pedestrian dead-reckoning systems and has limited several real-world applications of MIMUs. Thus, this research aimed at developing a full-state Robust Extended Kalman Filter (REKF) for accurate and robust orientation tracking with MIMUs, particularly during long-duration dynamic tasks. First, we structured a novel EKF by including the orientation quaternion, non-gravitational acceleration, gyroscope bias, and magnetic disturbance in the state vector. Next, the a posteriori error covariance matrix equation was modified to build a REKF. We compared the accuracy and robustness of our proposed REKF with four filters from the literature using optimal filter gains. We measured the thigh, shank, and foot orientation of nine participants while performing short-and long-duration tasks using MIMUs and a camera motion-capture system. REKF outperformed the filters from literature significantly (p<0.05) in terms of accuracy and robustness for long-duration tasks. For example, for foot MIMU, the median RMSE of (roll, pitch, yaw) were (6.5, 5.5, 7.8) and (22.8, 23.9, 25) deg for REKF and the best filter from the literature, respectively. For short-duration trials, REKF achieved significantly (p<0.05) better or similar performance compared to the literature. We concluded that including non-gravitational acceleration, gyroscope bias, and magnetic disturbance in the state vector, as well as using a robust filter structure, is required for accurate and robust orientation tracking, at least in long-duration tasks.