The rise of global temperature causes the degradation of the substantial reserves of carbon (C) stored in tundra soils, in which microbial processes play critical roles. Viruses are known to influence the soil C cycle by encoding auxiliary metabolic genes and infecting key microorganisms, but their regulation of microbial communities under climate warming remains unexplored. In this study, we evaluated the responses of viral communities for about 5 years of experimental warming at two depths (15 to 25 cm and 45 to 55 cm) in the Alaskan permafrost region. Our results showed that the viral community and functional gene composition and abundances (including viral functional genes related to replication, structure, infection, and lysis) were significantly influenced by environmental conditions such as total nitrogen (N), total C, and soil thawing duration. Although long-term warming did not impact the viral community composition at the two depths, some glycoside hydrolases encoded by viruses were more abundant at both depths of the warmed plots. With the continuous reduction of total C, viruses may alleviate methane release by altering infection strategies on methanogens. Importantly, viruses can adopt lysogenic and lytic lifestyles to manipulate microbial communities at different soil depths, respectively, which could be one of the major factors causing the differences in microbial responses to warming. This study provides a new ecological perspective on how viruses regulate the responses of microbes to warming at community and functional scales.