A Newton-Krylov algorithm is presented for two-dimensional Navier-Stokes aerodynamic shape optimization problems. The algorithm is applied to both the discrete-adjoint and the discrete ow-sensitivity methods for calculating the gradient of the objective function. The adjoint and ow-sensitivity equations are solved using a novel preconditioned generalized minimum residual (GMRES) strategy. Together with a complete linearization of the discretized Navier-Stokes and turbulence model equations, this results in an accurate and ef cient evaluation of the gradient. Furthermore, fast ow solutions are obtained using the same preconditioned GMRES strategy in conjunction with an inexact Newton approach. The performance of the new algorithm is demonstrated for several design examples, including inverse design, lift-constrained drag minimization, lift enhancement, and maximization of lift-to-drag ratio. In all examples, the norm of the gradient is reduced by several orders of magnitude, indicating that a local minimum has been obtained. By the use of the adjoint method, the gradient is obtained in from one-fth to one-half of the time required to converge a ow solution.