The paradox of cooperation among selfish individuals still puzzles scientific communities. Although a large amount of evidence has demonstrated that the cooperator clusters in spatial games are effective in protecting the cooperators against the invasion of defectors, we continue to lack the condition for the formation of a giant cooperator cluster that ensures the prevalence of cooperation in a system. Here, we study the dynamical organization of the cooperator clusters in spatial prisoner's dilemma game to offer the condition for the dominance of cooperation, finding that a phase transition characterized by the emergence of a large spanning cooperator cluster occurs when the initial fraction of the cooperators exceeds a certain threshold. Interestingly, the phase transition belongs to different universality classes of percolation determined by the temptation to defect b. Specifically, on square lattices, 1 < b < 4/3 leads to a phase transition pertaining to the class of regular site percolation, whereas 3/2 < b < 2 gives rise to a phase transition subject to invasion percolation with trapping. Our findings offer a deeper understanding of cooperative behavior in nature and society.