A resin capture and release strategy for making a combinatorial array of 2,4,5-trisubstituted pyrimidines is demonstrated by capturing beta-ketoesters and beta-ketoamides on a solid-supported piperazine. Through a cyclocondensation reaction, the solid-supported enaminone is reacted with several guanidines under heating or microwave irradiation affording the corresponding pyrimidines in good yield and chemical purity directly on solution. After this final step, the support can be effectively recycled.