To assess compliance with national and international guidelines for the initial empirical selection of antimicrobials, the duration of antimicrobial treatment in hospitalized patients with mild-to-moderate community-acquired pneumonia (CAP), and to analyze potential factors that could influence the duration of antimicrobials use. A retrospective study was conducted to collect medical records of patients admitted to the Department of Respiratory and Critical Care Medicine of Beijing Tongren Hospital with mild-to-moderate CAP from January 1, 2020 to November 30, 2022. The rationality of antimicrobial therapy was evaluated by comparing national and international guidelines, and the factors influencing the duration of antimicrobial therapy were analyzed by logistic regression. A total of 177 patients were enrolled. The age of patients was mainly distributed between 46 and 65 years old (38.42%). There were 82.49% of patients with basic diseases. In compliance with national, US, and European guidelines for the initial empirical antimicrobial selection in 177 CAP patients was 87.01%, 77.97%, and 78.53%. The mean duration of antibiotic treatment was 11.77±4.30 days, and patients switched from intravenous antimicrobial therapy to oral therapy within 2-10 days (5.15±2.84). Logistic regression analysis showed that the C-reactive protein (CRP) level at admission was an independent factor affecting the duration of antimicrobial use in hospitalized patients with mild-to-moderate CAP (OR=0.963, 95%CI: 0.947~0.979, p < 0.05). The results of this study indicated that the patients with a CRP level of 43.89mg/L on admission to the hospital were more likely to require antimicrobial therapy for longer than 7 days.