A 2‐year field study was conducted to measure nitrous oxide (N2O) and methane (CH4) in a rain‐fed spring maize cropland in the Loess Plateau, P. R. China, and to determine the effects of optimized nitrogen (N) fertilization practices on urea‐derived N2O emission factor (EF), grain yield, net greenhouse gas (NGHG) emission, and net greenhouse gas intensity (NGHGI). Five treatments were considered, including control (CK), conventional N fertilization (Con), optimal N fertilization (Opt), optimal N fertilization plus nitrification inhibitor (Opt + DCD), and optimal N fertilization with slow release urea (Opt + SR). Soil acted as a small sink for atmospheric CH4. Nitrogen fertilization and heavy rainfall events (>40 mm) were the main factors controlling N2O emissions. The annual mean EF ranged from 0.12 to 0.55%. Compared to conventional N fertilizer, nitrification inhibitor decreased the annual cumulative N2O, NGHG, and NGHGI emissions by 45, 52, and 48%, respectively, without decreasing grain yield. In conclusion, nitrification inhibitor addition was the most effective practice to reduce N2O emissions in the rain‐fed regions of Loess Plateau.