Let S be a semigroup generated by periodic elements and k be an infinite field. Suppose that the semigroup algebra kS has 1. The authors prove interesting properties of kS and S assuming that U(kS) satisfies a group identity (kS is called a GI-ring for short). In particular, S is locally finite and kS satisfies a polynomial identity. Thus Hartley's conjecture is confirmed for such semigroup algebras. If, furthermore, S is generated by a finite number of periodic elements, then they give necessary and sufficient conditions on S for kS to be a GI-ring. The authors obtain this result by proving first that if A is a semiprime GI-algebra over an infinite commutative domain D, such that A is generated as a D-algebra by U(A) and no element of D is a zero divisor in A, then A is a reduced ring. The latter fact is also used to give shorter proofs of some known results on group rings which are GI-rings.