Extreme ultraviolet (EUV) lithography is the most promising successor of current deep ultraviolet (DUV) lithography. The very short wavelength, reflective optics, and nontelecentric structure of EUV lithography systems bring in different imaging phenomena into the lithographic image synthesis problem. This paper develops a gradient-based inverse algorithm for EUV lithography systems to effectively improve the image fidelity by comprehensively compensating the optical proximity effect, flare, photoresist, and mask shadowing effects. A block-based method is applied to iteratively optimize the main features and subresolution assist features (SRAFs) of mask patterns, while simultaneously preserving the mask manufacturability. The mask shadowing effect may be compensated by a retargeting method based on a calibrated shadowing model. Illustrative simulations at 22 and 16 nm technology nodes are presented to validate the effectiveness of the proposed methods.