Background: The conquest of the land from aquatic habitats is a fascinating evolutionary event that happened multiple times in different phyla. Mollusks are among the organisms that successfully invaded the non-marine realm, resulting in the radiation of terrestrial panpulmonate gastropods. We used panpulmonates as a model to illuminate with comparative transcriptomics the selective pressures that shaped the transitions from marine into freshwater and terrestrial realms in this molluscan lineage. Results: De novo assembly of six panpulmonate transcriptomes resulted in 55,000 to 97,000 predicted open reading frames, of which 9 - 14% were functionally annotated. Adding published transcriptomes, we predicted 791 orthologous clusters shared among fifteen panpulmonate species, resulting in 702 amino acid and 736 codon-wise alignments. The branch-site test of positive selection applied to the codon-wise alignments showed twenty-eight genes under positive selection in the freshwater lineages and seven in the terrestrial lineages. Gene Ontology categories of these candidate genes include actin assembly, transport of glucose, and the tyrosine metabolism in the terrestrial lineages; and, DNA repair, metabolism of xenobiotics, mitochondrial electron transport, and ribosome biogenesis in the freshwater lineages. Conclusions: We identified candidate genes representing processes that may have played a key role during the water-to-land transition in Panpulmonata. These genes were involved in energy metabolism and gas-exchange surface development in the terrestrial lineages and in the response to the abiotic stress factors (UV radiation, osmotic pressure, xenobiotics) in the freshwater lineages. Our study expands the knowledge of possible adaptive signatures in genes and metabolic pathways related to the invasion of non-marine habitats in invertebrates.