Numerous intracellular bacterial pathogens interfere with macrophage function, including macrophage polarization, to establish a niche and persist. However, the spatiotemporal dynamics of macrophage polarization during infection within host remain to be investigated. Here, we implement a model of persistent Salmonella Typhimurium infection in zebrafish, which allows visualization of polarized macrophages and bacteria in real time at high resolution. While macrophages polarize toward M1-like phenotype to control early infection, during later stages, Salmonella persists inside non-inflammatory clustered macrophages. Transcriptomic profiling of macrophages showed a highly dynamic signature during infection characterized by a switch from pro-inflammatory to anti-inflammatory/pro-regenerative status and revealed a shift in adhesion program. In agreement with this specific adhesion signature, macrophage trajectory tracking identifies motionless macrophages as a permissive niche for persistent Salmonella. Our results demonstrate that zebrafish model provides a unique platform to explore, in a whole organism, the versatile nature of macrophage functional programs during bacterial acute and persistent infections.