SUMMARYThe extended finite element method (XFEM) enables the representation of cracks in arbitrary locations of a mesh. We introduce here a variant of the XFEM rendering an optimally convergent scheme. Its distinguishing features are as follows: (a) the introduction of singular asymptotic crack tip fields with support on only a small region around the crack tip (the enrichment region), (b) only one and two enrichment functions are added for anti-plane shear and planar problems, respectively and (c) the relaxation of the continuity between the enrichment region and the rest of the domain, and the adoption of a discontinuous Galerkin (DG) method therein. The method is provably stable for any positive value of a stabilization parameter, and by weakly enforcing the continuity between the two regions it eliminates 'blending elements' partly responsible for the suboptimal convergence of some early XFEMs. Moreover, the particular choice of enrichment functions results in a surprisingly sparse stiffness matrix that remains reasonably conditioned as the mesh is refined. More importantly, the stress intensity factors can be extracted with a satisfactory accuracy as primary unknowns. Quadrature strategies required for the optimal convergence are also discussed. Finally, the DG method was modified to retain stability based on an inf-sup condition.