This paper presents the first method that enables the fully automatic generation of triangular meshes suitable for the so-called non-uniform rational B-spline (NURBS)-enhanced finite element method (NEFEM). The meshes generated with the proposed approach account for the computer-aided design boundary representation of the domain given by NURBS curves. The characteristic element size is completely independent of the geometric complexity and of the presence of very small geometric features. The proposed strategy allows to circumvent the time-consuming process of de-featuring complex geometric models before a finite element mesh suitable for the analysis can be produced. A generalisation of the original definition of a NEFEM element is also proposed, enabling to treat more complicated elements with an edge defined by several NURBS curves or more than one edge defined by different NURBS. Three examples of increasing difficulty demonstrate the applicability of the proposed approach and illustrate the advantages compared with those of traditional finite element mesh generators. Finally, a simulation of an electromagnetic scattering problem is considered to show the applicability of the generated meshes for finite element analysis. (C) 2016 The Authors. International Journal for Numerical Methods in Engineering published by John Wiley & Sons Ltd.