The frequency of marine heatwaves (HWs) is projected to increase in the Mediterranean Sea over the next decades. An in situ mesocosm experiment was performed in a Mediterranean lagoon for 33 days. Three mesocosms were used as controls following the natural temperature of the lagoon. In three others, two HWs of + 5 °C compared to the controls were applied from experimental day (d) 1 to d5 (HW1) and from d11 to d15 (HW2). High-frequency data of oxygen, chlorophyll-a (chl-a), temperature, salinity and light from sensors immersed in all mesocosms were used to calculate gross primary production (GPP), respiration (R) and phytoplankton growth (µ) and loss (L) rates. Nutrients and phytoplankton community structure from pigments were also analyzed. HW1 significantly increased GPP, R, chl-a, µ and L by 7 to 38%. HW2 shifted the system toward heterotrophy by only enhancing R. Thus, the effects of the first HW resulted in the attenuation of those of a second HW on phytoplankton processes, but not on community respiration, which was strongly regulated by temperature. In addition, natural phytoplankton succession from diatoms to haptophytes was altered by both HWs as cyanobacteria and chlorophytes were favored at the expense of haptophytes. These results indicate that HWs have pronounced effects on Mediterranean plankton communities.