We consider a nonlinear model of an anaerobic digestion process with methane production. We propose a stabilizing control law involving piecewise constant feedback and study the asymptotic stability of the obtained closed‐loop system. An extremum seeking algorithm is applied to maximize the output. Numerical simulation results are also presented to illustrate the theoretical investigations.