  We describe all almost contact metric, almost hermitian and $G_2$-structures
admitting a connection with totally skew-symmetric torsion tensor, and prove
that there exists at most one such connection. We investigate its torsion form,
its Ricci tensor, the Dirac operator and the $\nabla$-parallel spinors. In
particular, we obtain solutions of the type II string in dimension $n=5,6$ and
7.
