Pine Island Ice Shelf (PIIS) buttresses the Pine Island Glacier, the key contributor to sea-level rise. PIIS has thinned owing to ocean-driven melting, and its calving front has retreated, leading to buttressing loss. PIIS melting depends primarily on the thermocline variability in its front. Furthermore, local ocean circulation shifts adjust heat transport within Pine Island Bay (PIB), yet oceanic processes underlying the ice front retreat remain unclear. Here, we report a PIB double-gyre that moves with the PIIS calving front and hypothesise that it controls ocean heat input towards PIIS. Glacial melt generates cyclonic and anticyclonic gyres near and off PIIS, and meltwater outflows converge into the anticyclonic gyre with a deep-convex-downward thermocline. The double-gyre migrated eastward as the calving front retreated, placing the anticyclonic gyre over a shallow seafloor ridge, reducing the ocean heat input towards PIIS. Reconfigurations of meltwater-driven gyres associated with moving ice boundaries might be crucial in modulating ocean heat delivery to glacial ice.