The mass mortality of Pacific oyster Crassostrea gigas has become a severe ecological and economic concern to Chinese aquaculture, which is proposed to be linked to the phytoplankton community in the farming waters. In the present study, both field and laboratory experiments were conducted to identify the phytoplankton taxa associated with oyster mortality and explore the molecular mechanism by which they affect the physiological health of oysters. The field experiment showed that more serious mortality of oysters was observed in the North Yellow Sea from July to September in 2018 (average survival rate of 75.11 %) than in 2019 (average survival rate of 85.78 %), with the proportion of Bacillariophyta (diatoms) in the phytoplankton community in 2018 lower than that in 2019. In comparison to 2019, reduced dry weight, lower glycogen and triglyceride contents in hepatopancreas, lower 17β-estradiol and testosterone concentrations in gonad, as well as a generally weaker immune response against Vibrio splendidus stimulation were detected in the oysters sampled in 2018. The treatment of oysters with either starvation (starvation group) or Nitzschia closterium f. minutissima feeding (N. closterium group) was conducted to verify the field findings, with individuals reared in natural seawater as control. After 40 days of N. closterium feeding, dry weight, glycogen and triglyceride contents in hepatopancreas significantly increased, as well as the biosynthesis of sex hormones and gonadal maturation were promoted compared to the control and starvation groups. Moreover, a much stronger immune response against V. splendidus stimulation was observed in the oysters of N. closterium group, with the fold-changes of norepinephrine content in serum, SOD activity in hepatopancreas, and the mRNA expression level of IL17-5 and HSP70 in haemocytes higher than those in the control and starvation groups. Collectively, these results suggested that lack of diatoms in the farming waters suppressed the energy storage and gonadal maturation of adult oysters, and also resulted in a compromised immune response against bacterial infection, which may be a leading cause of the mass mortality of oysters living in diatom-deficient waters during breeding seasons.