Given a standard Brownian motion and the equation of motion , we set St = max0≤s≤tXs and consider the optimal control problem supvE(Sτ − Cτ), where c > 0 and the supremum is taken over all admissible controls v satisfying vt ∈ [μ0, μ1] for all t up to τ = inf{t > 0|Xt ∉ (ℓ0, ℓ1)} with μ0 < 0 < μ1 and ℓ0 < 0 < ℓ1 given and fixed. The following control v∗ is proved to be optimal: “pull as hard as possible,” that is, if Xt < g∗(St), and “push as hard as possible,” that is, if Xt > g∗(St), where s ↦ g∗(s) is a switching curve that is determined explicitly (as the unique solution to a nonlinear differential equation). The solution found demonstrates that the problem formulations based on a maximum functional can be successfully included in optimal control theory (calculus of variations) in addition to the classic problem formulations due to Lagrange, Mayer, and Bolza.