A full implementation of the analytical stress tensor for periodic systems is reported in the TURBOMOLE program package within the framework of Kohn-Sham density functional theory using Gaussian-type orbitals as basis functions. It is the extension of the implementation of analytical energy gradients (Lazarski et al., Journal of Computational Chemistry 2016, 37, 2518-2526) to the stress tensor for the purpose of optimization of lattice vectors. Its key component is the efficient calculation of the Coulomb contribution by combining density fitting approximation and continuous fast multipole method. For the exchange-correlation (XC) part the hierarchical numerical integration scheme (Burow and Sierka, Journal of Chemical Theory and Computation 2011, 7, 3097-3104) is extended to XC weight derivatives and stress tensor. The computational efficiency and favorable scaling behavior of the stress tensor implementation are demonstrated for various model systems. The overall computational effort for energy gradient and stress tensor for the largest systems investigated is shown to be at most two and a half times the computational effort for the Kohn-Sham matrix formation. © 2019 Wiley Periodicals, Inc.