A bounded set Ω⊂Rd is called a spectral set if the space L2(Ω) admits a complete orthogonal system of exponential functions. We prove that a cylindric set Ω is spectral if and only if its base is a spectral set. A similar characterization is obtained of the cylindric sets which can tile the space by translations.