A finite element formulation for three dimensional (3D) contact mechanics using a mortar algorithm combined with a mixed penalty–duality formulation from an augmented Lagrangian approach is presented. In this method, no penalty parameter is introduced for the regularisation of the contact problem. The contact approach, based on the mortar method, gives a smooth representation of the contact forces across the bodies interface, and can be used in arbitrarily curved 3D configurations. The projection surface used for integrating the equations is built using a local Cartesian basis defined in each contact element. A unit normal to the contact surface is defined locally at each element, simplifying the implementation and linearisation of the equations. The displayed examples show that the algorithm verifies the contact patch tests exactly, and is applicable to large displacements problems with large sliding motions.Copyright © 2012 John Wiley & Sons, Ltd.