In this paper we investigate optimal control problems governed by a advection-diffusion-reaction equation. We present a method for deriving conditions in the form of Pontryagin’s principle. The main tools used are the Ekeland’s variational principle combined with penalization and spike variation techniques.