The title compound, C(17)H(22)N(4)O(3), comprises a 1,4-diazepine ring in a twist-boat conformation fused to a pyrimidine ring. The dihedral angle between the pyrimidine and phenyl rings is 80.8 (1)°. The crystal packing features N-H⋯O and C-H⋯O hydrogen bonds.