The haploid multicellular male gametophyte of plants, the pollen grain, is a terminally differentiated structure whose function ends at fertilization. Unlike pollen grains, the immature gametophyte retains its capacity for totipotent growth when cultured in vitro. Haploid embryo production from cultured immature male gametophytes is a widely used plant breeding and propagation technique that was described nearly 50 years ago, but one that is poorly understood at the mechanistic level. Using a chemical approach, we show that the switch to haploid embryogenesis is controlled by the activity of histone deacetylases (HDACs). Blocking HDAC activity with trichostatin A (TSA) in cultured immature male gametophytes of Brassica napus leads to a large increase in the proportion of cells that switch from pollen to embryogenic growth. Embryogenic growth is enhanced by, but not dependent on, the high temperature stress that is normally used to induce haploid embryogenesis in B. napus. The immature male gametophyte of Arabidopsis thaliana, which is recalcitrant for haploid embryo development in culture, also forms embryogenic cell clusters after TSA treatment. TSA treatment of immature male gametophytes for as little as eight hours was accompanied by hyperacetylation of histones H3 and H4, and by the upregulation of genes involved in cell-cycle progression, the auxin pathway and cell wall catabolism pathways. We propose that the totipotency of the immature male gametophyte in planta is kept in check by an HDAC-dependent mechanism, and that high temperature or other stresses used to induce haploid embryo development in culture impinge on this HDAC-dependent pathway.