A facile strategy for the synthesis of steroidal A- and D-ring fused pyrimidines has been accomplished in high yields via a one-pot reaction of steroidal ketones, aromatic aldehydes and amidine derivatives in presence of potassium tert-butoxide in refluxing ethanol. The generality of the reaction was also extended to non-steroidal ketones.