Linear‐quadratic regulator theory is commonly used in feedback optimization problems for power system stabilization. In this paper an extension of Gamkrelidze's maximum principle, which applies directly to non‐linear systems, is used to find an optimal feedback control law from a given practically implementable class of parametrized control structures. An algorithm for finding the optimal set of parameters is presented. The results obtained, using the optimal feedback control law determined by the given algorithm, indicate a substantial improvement of the transient performance of the system.