A spectrum of gamma rays containing more than 34 lines arising from concrete walls of the laboratory has been measured with a germanium-lithium-drifted detector having 4-keV resolution for 1332-keV gamma rays. The fact that the gamma rays originate from the concrete is supported by another measurement in which a 5- × 5-cm NaI(Tl) detector was moved near and away from the wall inside a lead-shielded channel intercepting a small portion of the wall and also by a Ge(Li) spectrum taken in another room of the laboratory. The gamma rays have been assigned to 40K and to the daughter products of thorium and uranium. The measured intensities are in good agreement with the decay schemes of the relevant isotopes. Concentrations of thorium, uranium, and potassium in the walls have been obtained from the spectra, and thus it has been shown that high-resolution gamma-ray spectroscopy can be used as an in situ nondestructive method to assess the contents of thorium and uranium minerals occurring even in an ill-defined geometry. The data also explain the nature of the gamma-ray background for an unshielded detector placed in a concrete building and reveal that most of that background, up to an energy of 8 MeV, originates from the natural radioactivity in the concrete.