Mantle wedge–derived arc volcanism ceased in southern Costa Rica after ca. 8 Ma because of subduction of the aseismic Cocos Ridge beneath the Central American arc and the subsequent opening of a slab window. Geochemical and isotopic compositions of small volumes of adakitic and alkalic backarc lavas erupted between 5.8 and 2 Ma identify a source derived from the Galapagos plume. The presence of this source is explained by an influx of Pacific upper mantle into the Caribbean mantle wedge through a slab window, where the alkalic rocks form by melting of the upwelling mantle and the adakites result from melting of the leading edge of the subducted Cocos Ridge. By using geochemical and isotopic signatures, we trace this upper mantle flow beneath Central America from southern Costa Rica northward at a rate of 40 mm/yr.