This paper presents the control algorithm and system design for a newly proposed automated emergency stop system, which aims to navigate the vehicle out of its travel lane to a safe road-side location when an emergency (e.g. driver fails to take control during fallback of the Dynamic Driving Task) occurs. To address the unique requirements of such a system, control techniques based on differential dynamic programming are developed. Optimal control sequence computation is broken down into step-by-step quadratic optimization and solved iteratively. Control constraints are addressed efficiently by a tailored Projected-Newton algorithm. The iterative control algorithm is then integrated into a real-time control system which considers both computation delay and modeling errors. The system employs a novel grid-based storage structure for recording all acceptable control commands computed within the iteration and uses a high frequency estimator for self-localization. During operation, the real-time control thread will extract commands from the grid cell corresponding to current states. Simulation results show strong potential of the proposed system for addressing the engineering challenges of the automated emergency stop function. The robustness of the system in presence of computation time delay and modelling errors is also demonstrated.