We introduce a novel scheme, DGCrack, to simulate dynamic rupture of earthquakes in three dimensions based on an hp-adaptive discontinuous Galerkin method. We solve the velocity-stress weak formulation of elastodynamic equations on an unstructured tetrahedral mesh with arbitrary mesh refinements (h-adaptivity) and local approximation orders (p-adaptivity). Our scheme considers second-order fault elements (P2) where dynamic-rupture boundary conditions are enforced throughad hocfluxes across the fault. To model the Coulomb slip-dependent friction law, we introduce a predictor-corrector scheme for estimating shear fault tractions, in addition to a special treatment of the normal tractions that guarantees the continuity of fault normal velocities. We verify the DGCrack by comparison with several methods for two spontaneous rupture tests and find excellent agreement (i.e., rupture times RMS errors smaller than 1.0%) provided that one or more fault elements resolve the fault cohesive zone. For a quantitative comparison, we introduce a methodology based on cross-correlation measurements that provide a simple way to quantify the similarity between solutions. Our verification tests include a 60° dipping normal fault reaching the free surface. The DGCrack method reveals convergence rates close to those of well-established methods and a numerical efficiency significantly higher than that of similar discontinuous Galerkin approaches. We apply the method to the 1992 Landers-earthquake fault system in a layered medium, considering heterogeneous initial stress conditions and mesh adaptivities. Our results show that previously proposed dynamic models for the Landers earthquake require a reevaluation in terms of the initial stress conditions that take account of the intricate fault geometry.