A dynamic PEM fuel cell model has been developed, taking into account spatial dependencies of voltage, current, material flows, and temperatures. The voltage, current, and therefore, the efficiency are dependent on the temperature and other variables, which can be optimized on the fly to achieve optimal efficiency. In this paper, we demonstrate that a model predictive controller, relying on a reduced-order approximation of the dynamic PEM fuel cell model can satisfy setpoint changes in the power demand, while at the same time, minimize fuel consumption to maximize the efficiency. The main conclusion of the paper is that by appropriate formulation of the objective function, reliable optimization of the performance of a PEM fuel cell can be performed in which the main tunable parameter is the prediction and control horizons, V and U, respectively. We have demonstrated that increased fuel efficiency can be obtained at the expense of slower responses, by increasing the values of these parameters.