The relationship between exposure to ambient air pollutants and emergency attendance for upper gastrointestinal bleeding (UGIB) remains inconclusive. This study examines the association between short-term exposure to various ambient pollutants and the risk of UGIB emergency attendance. Data on daily UGIB emergency attendance, ambient pollutants, and meteorological conditions in Hong Kong were collected from 2017 to 2022. A time-series study using a distributed lag non-linear model to analyze the data, considering lag days. Stratified analysis was performed based on sex, seasons, and the COVID-19 pandemic period. The burden was quantified using attributable fraction (AF) and number (AN). The study included 31,577 UGIB emergency records. Exposure to high levels of PM2.5 significantly increased the risk of UGIB emergency attendance from lag day 3 (RR: 1.012) to day 6 (RR: 1.008). High NO2 exposure also posed a significant risk from lag day 0 (RR: 1.026) to day 2 (RR: 1.014), and from lag day 5 (RR: 1.013) to day 7 (RR: 1.024). However, there was no association between UGIB and high O3 levels. The attributable burden of high-concentration NO2 exposure was higher compared to those of PM2.5. Males and elderly individuals (≥65years) faced a higher risk of UGIB emergencies, particularly during cold seasons. Our study suggests that both PM2.5 and NO2 exposure are associated with an increased risk of emergency attendance for UGIB. Ambient pollutant exposure has a stronger effect on UGIB in males and the elderly, particularly during cold seasons.