We introduce a class of countable groups by some abstract group-theoretic conditions. It includes linear groups with finite amenable radical and finitely generated residually finite groups with some non-vanishing $\ell^2$-Betti numbers that are not virtually a product of two infinite groups. Further, it includes acylindrically hyperbolic groups. For any group $\Gamma$ in this class we determine the general structure of its possible lattice embeddings, i.e. of all compactly generated, locally compact groups that contain $\Gamma$ as a lattice. This leads to a precise description of possible non-uniform lattice embeddings of groups in this class. Further applications include the determination of possible lattice embeddings of fundamental groups of closed manifolds with pinched negative curvature.