The pseudogap phenomenon in the cuprates is arguably the most mysterious puzzle in the field of high-temperature superconductivity. The tetragonal cuprate HgBa2CuO4+delta, with only one CuO2 layer per primitive cell, is an ideal system to tackle this puzzle. Here, we measure the magnetic susceptibility anisotropy within the CuO2 plane with exceptionally high-precision magnetic torque experiments. Our key finding is that a distinct two-fold in-plane anisotropy sets in below the pseudogap temperature T*, which provides thermodynamic evidence for a nematic phase transition with broken four-fold symmetry. Surprisingly, the nematic director orients along the diagonal direction of the CuO2 square lattice, in sharp contrast to the bond nematicity along the Cu-O-Cu direction. Another remarkable feature is that the enhancement of the diagonal nematicity with decreasing temperature is suppressed around the temperature at which short-range charge-density-wave formation occurs. Our result suggests a competing relationship between diagonal nematic and charge-density-wave order in HgBa2CuO4+delta.