Optimal control problems with delays in state and control variables are studied. Constraints are imposed as mixed control–state inequality constraints. Necessary optimality conditions in the form of Pontryagin's minimum principle are established. The proof proceeds by augmenting the delayed control problem to a nondelayed problem with mixed terminal boundary conditions to which Pontryagin's minimum principle is applicable. Discretization methods are discussed by which the delayed optimal control problem is transformed into a large-scale nonlinear programming problem. It is shown that the Lagrange multipliers associated with the programming problem provide a consistent discretization of the advanced adjoint equation for the delayed control problem. An analytical example and numerical examples from chemical engineering and economics illustrate the results. Copyright © 2008 John Wiley & Sons, Ltd.