To investigate the early immune responses and explore the optimal vaccination periods, Nile tilapia at 1, 7, 14, 21, 28, 35, and 42 days after yolk sac collapse (DAYC), were immersed in formalin-killed Streptococcus agalactiae vaccine (FKV-SA). The results found that specific IgM by ELISA in 21 DAYC (0.108 g) was first detected at 336 h after vaccination (hav), whereas 28-42 DAYC (0.330 - 0.580 g), could be initially detected at 24 hav. qRT-PCR analysis of the TCRβ, CD4, MHCIIα, IgHM, IgHT, and IgHD genes at 21- 42 DAYC immunized with FKV-SA immersion route for 24, 168 and 336 hav, revealed that most immune-related genes were significantly higher in the vaccinated larvae in all DAYCs than the control larvae (P < 0.05) after 336 hav. Immunohistochemistry demonstrated the stronger signals of IgM in the gills, head kidney, and intestine tissues at 21, 28, and 35 DAYC were observed in all vaccinated larvae compared with the control. Interestingly, at all DAYCs, FKV-SA larvae exhibited significantly higher survival rates and an increased relative percent survival (RPS) than the control after challenge with viable S. agalactiae, particularly in larval fish that were immunized with FKV-SA for 168 and 336 hav (P < 0.05).