The HIV-1 epidemic among men who have sex with men (MSM) has been spreading throughout China. Shanghai, a central gathering place for MSM, is facing a continuously increasing incidence of HIV-1 infection. In order to better understand the dynamics of HIV-1 diversity and its influence on patient’s immune status at baseline on diagnosis, 1265 newly HIV-1-infected MSM collected from January 2009 to December 2013 in Shanghai were retrospectively analyzed for genetic subtyping, CD4+T cell counts, and viral loads. HIV-1 phylogenetic analysis revealed a broad viral diversity including CRF01_AE (62.13%), CRF07_BC (24.51%), subtype B (8.06%), CRF55_01B (3.24%), CER67_01B (0.95%), CRF68_01B (0.4%), CRF08_BC (0.08%) and CRF59_01B (0.08%). Twenty-four unique recombination forms (URFs) (1.98%) were identified as well. Bayesian inference analysis indicated that the introduction of CRF01_AE strain (1997) was earlier than CRF07_BC strain (2001) into MSM population in Shanghai based on the time of the most recent common ancestor (tMRCA). Three epidemic clusters and five sub-clusters were found in CRF01_AE. Significantly lower CD4+T cell count was found in individuals infected with CRF01_AE than in those infected with CRF07_BC infection ( P<0.01), whereas viral load was significantly higher those infected with CRF01_AE than with CRF07_BC ( P<0.01). In addition, the patients with >45 years of age were found to have lower CD4+T cell counts and higher viral loads than the patients with <25 years of age ( P<0.05). This study reveals the presence of HIV-1 subtype diversity in Shanghai and its remarkable influence on clinical outcome. A real-time surveillance of HIV-1 viral diversity and phylodynamics of epidemic cluster, patient’s baseline CD4+T cell count and viral load would be of great value to monitoring of disease progression, intervention for transmission, improvement of antiretroviral therapy strategy and design of vaccines.