Antihistamines alleviate the side effects of antitumor drugs and exert antitumor effects. This study aimed to investigate the potential impact of short-term concomitant use of antihistamines with immune checkpoint inhibitor (ICI) therapy on the efficacy and immune-related adverse events (irAEs) of immunotherapy for patients with advanced lung cancer. We retrospectively analyzed the medical records of 211 patients diagnosed with advanced primary lung cancer and treated with immunotherapy at Tianjin Medical University Cancer Institute and Hospital between January 1, 2018, and January 1, 2022. Among these patients, 109 who received H1 antihistamine during the infusion of anti-programmed cell death-1 (PD-1) and anti-programmed cell death ligand 1 (PD-L1) antibodies were assigned to the experimental group; meanwhile, the remaining 102 patients who did not receive H1 antihistamines were assigned to the control group. Balancing was achieved through inverse probability of treatment weight (IPTW) estimation. The data were analyzed using Kaplan-Meier curves and Cox regression analyses. The median progression-free survival (mPFS) was 12.7 months in the experimental group and 4.3 months in the control group, while the median overall survival (mOS) was 32.8 months in the experimental group and 18.1 months in the control group. In the experimental group, patients treated with only H1 antihistamines had longer mPFS and mOS compared with those who received H1 plus H2 antihistamines. Similarly, in the control group, patients who did not receive antihistamines had a longer mPFS and mOS than those who only received H2 antihistamines. After conducting multivariate analyses, we found that H1 and H2 antihistamines were respectively identified as good and poor independent prognostic factors for both progression-free survival (PFS) and overall survival (OS). The rates of irAEs in the experimental and control groups were 52.4% and 69.2%, respectively, and grade ≥3 irAEs occurred in 4.5% and 25.9% of patients, respectively. Concomitant use of H1 antihistamines can improve immunotherapy efficacy and reduce irAEs. Meanwhile, concomitant use of H2 antihistamines is associated with reduced PFS and OS time.