If a group satisfies $x^3=1$ for all $x$, is it necessarily abelian?

I know that any group satisfying $x^2=1$ for all $x$ is abelian. Is the same true if $x^3=1$? I don't think it is, but I can't find a basic counterexample.


For any odd prime $p$, there is a nonabelian group $H_p$ of order $p^3$ and such that $x^p = 1$ for all $x \in H_p$: the Heisenberg group modulo p.

Added: As Dylan Moreland points out, this expository note of Keith Conrad gives a very nice discussion of the groups of order $p^3$, including the Heisenberg groups $H_p$.