In cucumber (Cucumis sativus L.), the differentiation and development of female flowers are important processes that directly affect the fruit yield and quality. Sex differentiation is mainly controlled by three ethylene synthase genes, F (CsACS1G), M (CsACS2), and A (CsACS11). Thus, ethylene plays a key role in the sex differentiation in cucumber. The “one-hormone hypothesis” posits that F and M regulate the ethylene levels and initiate female flower development in cucumber. Nonetheless, the precise molecular mechanism of this process remains elusive. To investigate the mechanism by which F and M regulate the sex phenotype, three cucumber near-isogenic lines, namely H34 (FFmmAA, hermaphroditic), G12 (FFMMAA, gynoecious), and M12 (ffMMAA, monoecious), with different F and M loci were generated. The transcriptomic analysis of the apical shoots revealed that the expression of the B-class floral homeotic genes, CsPI (Csa4G358770) and CsAP3 (Csa3G865440), was immensely suppressed in G12 (100% female flowers) but highly expressed in M12 (∼90% male flowers). In contrast, CAG2 (Csa1G467100), which is an AG-like C-class floral homeotic gene, was specifically highly expressed in G12. Thus, the initiation of female flowers is likely to be caused by the downregulation of B-class and upregulation of C-class genes by ethylene production in the floral primordium. Additionally, CsERF31, which was highly expressed in G12, showed temporal and spatial expression patterns similar to those of M and responded to the ethylene-related chemical treatments. The biochemical experiments further demonstrated that CsERF31 could directly bind the promoter of M and promote its expression. Thus, CsERF31 responded to the ethylene signal derived from F and mediated the positive feedback regulation of ethylene by activating M expression, which offers an extended “one-hormone hypothesis” of sex differentiation in cucumber.