The theory of optimal control is based on two approaches, the dynamic programming method (Bellman equation) and Pontryagin maximum principle. Pontryagin maximum principle is applied in the physics of nuclear reactors when optimizing various transient processes. The mathematical justification of this theory is based on the elements of convex analysis, which is not used by physicists and engineers, so the physical issues are less studied in scientific literature. The subject of the study is a nuclear power reactor of the WWER type. The problem of minimizing its shutdown time, bypassing the iodine pit is solved and it is possible to start up the reactor at any moment after its shutdown. Analytical and numerical methods are used. The paper considers an example of applying the maximum principle for optimal control of the process of shutting down a nuclear reactor bypassing the iodine pit. A physical mathematical model of the Pontryagin principle is formulated. The process of optimal control of reactor shutdown for large and small reactivity margins is justified and calculated. Pontryagin principle does not contain an algorithm to find an optimization process; the stages of the process must be selected based on physical considerations, but these stages must satisfy the specified principle. Based on the Pontryagin principle, the results of the study make it possible to draw up a step-by-step action plan when shutting down a WWER-type reactor with any value of the reactivity margin and its switching is possible at any time after the transition process, which avoids downtime. The proposed plan can be used both in mathematical modeling of transient processes in a reactor and in reactor control systems to improve its controllability and, consequently, to improve safety.