Safe and comfortable driving experience includes the improvement of handling performance and stability control. This paper proposed a coordinated controller based on the function allocation for the handling performance and stability of distributed drive electric vehicles. The proposed controller has three layers. The upper control layer designs a dynamic stability envelope boundary suitable for various driving conditions through the phase plane method, and on this basis, the function allocation rules of torque vector control (TVC) strategy and electronic stability control (ESC) strategy were formulated. The medium control layer used the robust [Formula: see text] dynamic output feedback control method and the improved particle swarm optimization (PSO) parameter self-adjusting method to calculate the additional yaw moment required by the TVC strategy and the ESC strategy, respectively. The two types of additional yaw moment are implemented by the in-wheel motor and the hydraulic brake mechanism respectively. The lower control layer optimized the four-wheel torque and braking force based on the optimal tire load rate using the quadratic programming method. The proposed coordinated controller was performed in the CarSim/Simulink co-simulation platform and tested in a real vehicle platform. The results show that the proposed controller can improve the vehicle dynamic response according to the driver’s intention, thus bringing the better handling performance and stability.