Let R denote either a group algebra over a field of characteristic p > 3 or the restricted enveloping algebra of a restricted Lie algebra over a field of characteristic p > 2. Viewing R as a Lie Algebra in the natural way, our main result states that R satisfies a law of the form [[x 1, x 2, …, x n], [x n + 1, x n + 2, …, x n + m], x n + m + 1] = 0 if and only if R is Lie nilpotent. It is deduced that R is commutative provided p > 2 max m, n. Group algebras over fields of characteristic p = 3 are shown to be Lie nilpotent if they satisfy an identity of the form [[x 1,x 2,…,x n], [x n + 1, x n + 2, …, x n + m]] = 0 . It was previously known that Lie centre-by-metabelian group algebras are commutative provided p > 3, and that a Lie soluble group algebra of derived length n is commutative if its characteristic exceeds 2 n .