Naval sonar systems produce signals which may affect the behavior of harbor porpoises, though their effect may be reduced by ambient noise. To show how natural ambient noise influences the effect of sonar sweeps on porpoises, a porpoise in a pool was exposed to 1-s duration up-sweeps, similar in frequency range (6-7 kHz) to those of existing naval sonar systems. The sweep signals had randomly generated sweep intervals of 3-7 s (duty cycle: 19). Behavioral parameters during exposure to signals were compared to those during baseline periods. The sessions were conducted under five background noise conditions: the local normal ambient noise and four conditions mimicking the spectra for wind-generated noise at Sea States 2-8. In all conditions, the sweeps caused the porpoise to swim further away from the transducer, surface more often, swim faster, and breathe more forcefully than during the baseline periods. However, the higher the background noise level, the smaller the effects of the sweeps on the surfacing behavior of the porpoise. Therefore, the effects of naval sonar systems on harbor porpoises are determined not only by the received level of the signals and the hearing sensitivity of the animals but also by the background noise. © 2011 Acoustical Society of America.