The present invention discloses a method of producing male or female sterile plants comprising the steps of: transforming plant material with a polynucleotide encoding at least one enzyme that reacts with a non-toxic plant material to produce a plant-toxic material , regenerating such transformed material into plants, wherein the period of male or female gamete formation and / or maturation is not exceeded, the non-phytotoxic substance is applied to said plants, whereby the non-phytotoxic substance provides the phytotoxic The production of a substance that selectively prevents the formation of said gametes or renders them nonfunctional, wherein the enzyme is preferentially expressed in the male or female reproductive structures, is characterized in that: (i) non-toxic phytotoxicity From: Ester derivatives of non-phosphonate herbicides of direct phytotoxicity to non-green tissues, D-alpha amino acids, peptide derivatives of non-protein D-alpha amino acids, S-para to aryloxyphenoxypropionic acids enantiomer and S-enantiomer of ester derivatives of aryloxyphenoxypropionic acid, and (ii) enzyme selected from: carboxylesterase, D-amino acid oxidase, D-amino acid dehydrogenase, D-amino acid Racemase, 2-arylpropionyl-CoA epimerase, alpha-formyl-CoA racemase, thioesterase and acyl-CoA synthetase.