The disturbance rejection problem for linear systems with both state delay and control delay is considered. Using a model transformation, the time-delay system is transformed into a nondelayed system. The disturbance rejection control law is obtained by solving its optimal regulation problem. A dynamic compensator is designed, which is combined by an internal model corresponding to the disturbances and an optimal control law which consists of state and control memory terms and a disturbance compensator. Numerical simulations are used to illustrate the effectiveness of the optimal regulator.