This study investigates the effect of ambient oxygen concentration on biodiesel and diesel spray combustion under simulated compression-ignition engine conditions in a constant-volume chamber. The apparent heat release rate (AHRR) is calculated based on the measured pressure. High-speed imaging of OH* chemiluminescence and natural luminosity (NL) is employed to visualize the combustion process. Temporally and spatially resolved NL and OH* contour plots are obtained. The result indicates that AHRR depends monotonically on the ambient oxygen concentration for both fuels. A lower oxygen concentration yields a slower AHRR increase rate, a lower peak AHRR value, but a higher AHRR value during the burn-out stage when compared with higher ambient oxygen concentration conditions. OH* chemiluminescence and NL contours indicate that biodiesel may experience a longer premixed-combustion duration. The 18% ambient O2 condition works better for biodiesel than diesel in reducing soot luminosity. With 12% O2, diesel combustion is significantly degraded. However, both fuels experience low temperature combustion at 10% O2. These results may imply that biodiesel is able to achieve the desired lower soot production under a moderate oxygen level with higher combustion efficiency, while diesel needs to be burned under very low ambient oxygen concentration for low soot production.