For an arbitrary class M of groups, L(M) denotes a class of all groups G the normal closure of any element in which belongs to M; qM is a quasivariety generated by M. Fix a prime p, p ≠ 2, and a natural number s, s ≥ 2. Let qF be a quasivariety generated by a relatively free group in a class of nilpotent groups of class at most 2 and exponent p^{s}, with commutator subgroups of exponent p. We give a description of a Levi class generated by qF. Fix a natural number n, n ≥ 2. Let K be an arbitrary class of nilpotent groups of class at most 2 and exponent 2^{n}, with commutator subgroups of exponent 2. Assume also that for all groups in K, elements of order 2^{m}, 0 < m < n, are contained in the center of a given group. It is proved that a Levi class generated by a quasivariety qK coincides with a variety of nilpotent groups of class at most 2 and exponent 2^{n}, with commutator subgroups of exponent 2.