We study three-dimensional Lie groups with left-invariant Lorentz metric and almost harmonic (with zero curl and divergence) Schouten–Weyl tensor. Contracting the Schouten-Weyl tensor in an arbitrary direction, we introduce an antisymmetric 2-tensor and study the structure of three-dimensional Lie groups and algebras with left-invariant Riemann metric in which this tensor is harmonic. Bibliography: 8 titles.