A process for preparing caprolactam by reacting 6-aminocapronitrile with water in the presence of catalysts comprises using a starting mixture of 6-aminocapronitrile and the tetrahydroazepine derivative of the formula
and conducting the reaction in liquid phase in the presence of a heterogeneous catalyst. Also describes a process for preparing said tetrahydroazepine derivative I and its use for preparing caprolactam and polycaprolactam.