In loess oil-production areas, oil leakage not only contaminates the loess, but also changes its mechanical properties. This study aimed to evaluate the effect of diesel oil contamination on mechanical behaviors of loess though extensive laboratory tests conducted on loess with different oil contents (0% to 16%) and dry densities (1.35, 1.45, and 1.55 g/cm3). Two different modes of oil contamination were proposed and applied in compression tests, direct shear tests and unconfined compressive strength tests to study the compressibility and strength characteristics of diesel-contaminated loess. Results show that oil-contamination modes have certain effects on the mechanical behaviors of loess. Under the first mode of oil contamination, compared with clean loess, the compressibility of contaminated loess increases and its unconfined compressive strength and shear strength all decrease. The compression modulus, friction angle, unconfined compressive strength of diesel-contaminated loess using the second mode of oil contamination are larger than those in the first mode of oil contamination at the same oil content and dry density. Understanding these effects of oil pollution can significantly guide soil and environment-remediation activities in oil-production areas.