The mammalian TRPM gene family can be subdivided into distinct categories of cation channels that are either highly permeable for Ca(2+) (TRPM3/6/7), nonselective (TRPM2/8), or even Ca(2+) impermeable (TRPM4/5). TRPM6/7 are fused to alpha-kinase domains, whereas TRPM2 is linked to an ADP-ribose phosphohydrolase (Nudix domain). At a molecular level, the evolutionary steps that gave rise to the structural and functional TRPM channel diversity remain elusive. Here, we provide phylogenetic evidence that Nudix-linked channels represent an ancestral type of TRPMs that is present in various phyla, ranging from protists to humans. Surprisingly, the pore-forming segments of invertebrate TRPM2-like proteins display high sequence similarity to those of Ca(2+)-selective TRPMs, while human TRPM2 is characterized by a loss of several conserved residues. Using the patch-clamp technique, Ca(2+) imaging, and site-directed mutagenesis, we demonstrate that restoration of only two "ancient" pore residues in human TRPM2 (Q981E/P983Y) significantly increased (approximately 4-fold) its permeability for Ca(2+). Conversely, introduction of a "modern" sequence motif into mouse TRPM7 (E1047Q/Y1049P) resulted in the loss of Ca(2+) permeation and a linear TRPM2-like current-voltage relationship. Overall, our findings provide an integrative view on the evolution of the domain architecture and the structural basis of the distinct ion permeation profiles of TRPM channels.