The aim of this paper is to introduce a new construction called the square extension of a groupoid and to examine its properties. In particular, the associative square extension of bands is considered and it is applied for a structural characterization of semigroups with n + 1 different essentially n-ary term operations for every positive integer n.