The observation of topological phases beyond two dimensions, as widely reported in solid-state systems1,2, has been an open challenge for ultracold atoms. Although many theoretical schemes have been proposed, the experimental complexity in realizing and characterizing the three-dimensional (3D) band structure has acted as a barrier against experiments achieving this. Here, we realize a 3D spin–orbit coupled nodal-line semimetal in an optical Raman lattice filled with ultracold fermions, and observe the bulk line nodes in the band structure. The realized topological semimetal exhibits an emergent magnetic group symmetry. This allows detection of the nodal lines by effectively reconstructing the 3D topological band from a series of measurements of integrated spin textures, which precisely render spin textures on the parameter-tuned magnetic-group-symmetric planes. The detection technique can be applied generally to explore 3D topological states of similar symmetries. Furthermore, we observe the band inversion lines from topological quench dynamics, which are bulk counterparts of Fermi arc states and connect the Dirac points, reconfirming the realized topological band. Our results demonstrate an approach to effectively observe 3D band topology, and open the way to probe exotic topological physics for ultracold atoms in high dimensions.