Andromonoecy is a widespread sexual system in angiosperms, characterized by plants carrying both male and bisexual flowers. Monoecy is characterized by the presence of both male and female flowers on the same plant. In cucumber, these sexual forms are controlled by the identity of the alleles at the M locus. In melon, we recently showed that the transition from monoecy to andromonoecy result from a mutation in 1-aminocyclopropane-1-carboxylic acid synthase (ACS) gene, CmACS-7. To isolate the andromonoecy gene in cucumber we used a candidate gene approach in combination with genetical and biochemical analysis. We demonstrated co-segregation of CsACS2, a close homolog of CmACS-7, with the M locus. Sequence analysis of CsACS2 in cucumber accessions identified four CsACS2 isoforms, three in andromonoecious and one in monoecious lines. To determine whether the andromonoecious phenotype is due to a loss of ACS enzymatic activity, we expressed the four isoforms in Escherichia coli and assayed their activity in vitro. Like in melon, the isoforms from the andromonoecious lines showed reduced to no enzymatic activity and the isoform from the monoecious line was active. Consistent with this, the mutations leading andromonoecy were clustered in the active site of the enzyme. Based on this, we concluded that active CsACS2 enzyme leads to the development of female flowers in monoecious lines, whereas a reduction of enzymatic activity yields hermaphrodite flowers. Consistent with this, CsACS2, like CmACS-7 in melon, is expressed specifically in carpel primordia of buds determined to develop carpels. Following ACS expression, inter-organ communication is likely responsible for the inhibition of stamina development. In both melon and cucumber, flower unisexuality seems to be the ancestral situation, as the majority of Cucumis species are monoecious. Thus, the ancestor gene of CmACS-7/CsACS2 likely have controlled the stamen development before speciation of Cucumis sativus (cucumber) and Cucumis melo (melon) that have diverged over 40 My ago. The isolation of the genes for andromonoecy in Cucumis species provides a molecular basis for understanding how sexual systems arise and are maintained within and between species.