In the ten-membered 1,3,4,6-tetrahydro-2H-pyrido[1,2-a]pyrimidine ring system of the title compound, C17H15N5, the 1,2-dihydropyridine ring is essentially planar (r.m.s. deviation = 0.001 Å), while the 1,3-diazinane ring has a distorted twist-boat conformation. In the crystal, molecules are linked by N—H. . .N and C—H. . .N hydrogen bonds, forming a three-dimensional network. In addition, C—H. . .π interactions form layers parallel to the (100) plane. Thus, crystal-structure cohesion is ensured. According to a Hirshfeld surface study, H. . .H (40.4%), N. . .H/H. . .N (28.6%) and C. . .H/H. . .C (24.1%) interactions are the most important contributors to the crystal packing. © 2024 International Union of Crystallography. All rights reserved.