Confining photons in a finite volume is highly desirable in modern photonic devices, such as waveguides, lasers and cavities. Decades ago, this motivated the study and application of photonic crystals, which have a photonic bandgap that forbids light propagation in all directions(1-3). Recently, inspired by the discoveries of topological insulators(4,5), the confinement of photons with topological protection has been demonstrated in two-dimensional (2D) photonic structures known as photonic topological insulators(6-8), with promising applications in topological lasers(9,10) and robust optical delay lines(11). However, a fully three-dimensional (3D) topological photonic bandgap has not been achieved. Here we experimentally demonstrate a 3D photonic topological insulator with an extremely wide (more than 25 per cent bandwidth) 3D topological bandgap. The composite material (metallic patterns on printed circuit boards) consists of split-ring resonators (classical electromagnetic artificial atoms) with strong magneto-electric coupling and behaves like a 'weak' topological insulator (that is, with an even number of surface Dirac cones), or a stack of 2D quantum spin Hall insulators. Using direct field measurements, we map out both the gapped bulk band structure and the Dirac-like dispersion of the photonic surface states, and demonstrate robust photonic propagation along a non-planar surface. Our work extends the family of 3D topological insulators from fermions to bosons and paves the way for applications in topological photonic cavities, circuits and lasers in 3D geometries.