Synthesis of A-/D-ring functionalized azasteroids of the androstene and estrane series. Steroidal β-chlorovinyl aldehydes 2 as ambident elecrophiles easily undergo cyclizations with bis-nucleophilic guanidine and acetimidamide under mild reaction conditions (2 equiv excess, under reflux in methanol with potassium carbonate) providing A-/D-fused steroidal pyrimidines 3a–f in 30–89% yields. The reaction of acetimidamide with 2 equiv excess of potassium carbonate in DMF produced heterosteroids 4a–c containing the dihydrotriazine substituent at the 16-C or 2-C position of the steroid core in 29–32% yields.