An electric power steering system comprising: a motor that applies assist force to a steering mechanism of a vehicle; a torque sensor that outputs a detection signal corresponding to a steering torque applied to the steering mechanism; and a controller that controls driving of the motor to cause an output torque of the motor to follow an assist command value, wherein the controller computes a detected steering torque value (τ) on the basis of the detection signal, and provides compensation to a basic assist command value based on the detected steering torque value (τ) with use of a compensation value to compute the assist command value, characterized in that the controller switches control mode between first control in which driving of the motor is controlled based on the detected steering torque value (τ) that is periodically updated continuously in a predetermined sampling cycle and second control in which driving of the motor is controlled based on at least a held detected steering torque value (τ) while a period in which the detected steering torque value (τ) is periodically updated and a period in which the detected steering torque value (τ) is held are alternately repeated, and switches the compensation value between a compensation value used when the first control is being executed and a compensation value used when the second control is being executed. a motor that applies assist force to a steering mechanism of a vehicle; a torque sensor that outputs a detection signal corresponding to a steering torque applied to the steering mechanism; and a controller that controls driving of the motor to cause an output torque of the motor to follow an assist command value, wherein the controller computes a detected steering torque value (τ) on the basis of the detection signal, and provides compensation to a basic assist command value based on the detected steering torque value (τ) with use of a compensation value to compute the assist command value, characterized in that the controller switches control mode between first control in which driving of the motor is controlled based on the detected steering torque value (τ) that is periodically updated continuously in a predetermined sampling cycle and second control in which driving of the motor is controlled based on at least a held detected steering torque value (τ) while a period in which the detected steering torque value (τ) is periodically updated and a period in which the detected steering torque value (τ) is held are alternately repeated, and switches the compensation value between a compensation value used when the first control is being executed and a compensation value used when the second control is being executed. switches control mode between first control in which driving of the motor is controlled based on the detected steering torque value (τ) that is periodically updated continuously in a predetermined sampling cycle and second control in which driving of the motor is controlled based on at least a held detected steering torque value (τ) while a period in which the detected steering torque value (τ) is periodically updated and a period in which the detected steering torque value (τ) is held are alternately repeated, and switches the compensation value between a compensation value used when the first control is being executed and a compensation value used when the second control is being executed.