Defect modes in two-dimensional periodic photonic structures have found use in diverse optical devices. For example, photonic crystal cavities confine optical modes to subwavelength volumes and can be used for enhancement of nonlinearity, lasing and cavity quantum electrodynamics. Defect-core photonic crystal fibres allow for supercontinuum generation and endlessly single-mode fibres with large cores. However, these modes are notoriously fragile: small structural change leads to significant detuning of resonance frequency and mode volume. Here, we show that photonic topological crystalline insulator structures can be used to topologically protect the mode frequency at mid-gap and minimize the volume of a photonic defect mode. We experimentally demonstrate this in a femtosecond-laser-written waveguide array by observing the presence of a topological zero mode confined to the corner of the array. The robustness of this mode is guaranteed by a topological invariant that protects zero-dimensional states embedded in a two-dimensional environment—a novel form of topological protection that has not been previously demonstrated.