In the open ocean without terrain boundaries, marine invertebrates with pelagic larvae can migrate long distances using ocean currents, suggesting reduced genetic diversification. Contrary to this assumption, however, genetic differentiation is often observed in marine invertebrates. In the present study, we sought to explain how population structure is established in the western Pacific Ocean, where the strong Kuroshio Current maintains high levels of gene flow from south to north, presumably promoting genetic homogeneity. We determined the population structure of the pearl oyster, Pinctada fucata, in the Indo‐Pacific Ocean using genome‐wide genotyping data from multiple sampling localities. Cluster analysis showed that the western Pacific population is distinct from that of the Indian Ocean, and that it is divided into northern (Japanese mainland) and southern (Nansei Islands, China, and Cambodia) populations. Genetic differentiation of P. fucata can be explained by geographic barriers in the Indian Ocean and a local lagoon, and by environmental gradients of sea surface temperature (SST) and oxygen concentration in the western Pacific. A genome scan showed evidence of adaptive evolution in genomic loci, possibly associated with changes in environmental factors, including SST and oxygen concentration. Furthermore, Bayesian simulation demonstrated that the past population expansion and division are congruent with ocean warming after the last glacial period. It is highly likely that the environmental gradient forms a genetic barrier that diversifies P. fucata populations in the western Pacific. This hypothesis helps to explain genetic differentiation and possible speciation of marine invertebrates.