Heterocyclization reactions between N-arylmaleimides and 6-aminouracils were studied in detail. It was established that several directions are possible depending on the nature of reaction medium and the substituent character in the uracil component. The synthetic procedure leading to N-phenyl-2,4,7-trioxopyrido[2,3-d]pyrimidine-5-carboxamides in good-to-high yields was developed and key stages of the corresponding reaction were established.