This paper proposes a novel approach to rejecting nonrandom bounded exogenous disturbances in linear discrete-time control systems by means of dynamic output feedback. The approach is based on reducing the original problem to a matrix optimization problem with the gain and observer matrices as the variables. A gradient descent method for finding dynamic output feedback is derived and justified.