Near-surface attenuation and site effects are investigated using the seismograms of 17 local earthquakes recorded at depths of 0, 0.3, 1.5, 2.5, and 2.9 km in the Cajon Pass borehole, southern California. The borehole penetrates 500 m of Miocene sandstone and then crystalline, granitic basement rock. Previous estimates of site response have been limited to shallower holes, where the surface reflection interferes with the upgoing direct wave, and the deepest sensor is not below the severe near-surface effects, in bedrock. Spectral ratios of the direct P and S waves for each earthquake between the different recording levels are well modeled with frequency-independent Q and amplification. At the borehole, QP ∼ 27 ± 8, and QS ∼ 21 ± 7 in the upper 2.9 km, increasing from QP ∼26 and QS ∼15 in the upper 300 m to QP ∼133 and QS ∼47 between 1.5 and 3 km. One event was also recorded at a surface granite site, less than 1.5 km from the wellhead. Comparison of the 2.9-km recording with that at this granite site gives QP ∼50 and QS ∼23. The similarity of these values with those of previous studies at a wide range of sites suggests that Q is very low in the near surface, independent of rock type. Near-surface amplification appears considerably more site dependent. At the wellhead, the amplifications at 1 Hz of the direct P and S waves are 12 ± 7 and 13 ± 7, respectively. These values include the free-surface effect and are in reasonable agreement with the impedance contrast from the borehole logs. At the granite site, amplification of both P and S waves is less than four; direct-wave amplification at the wellhead is therefore at least three times that of the granite site. The spectra of the direct and coda waves of the one earthquake recorded at both the wellhead and granite sites are compared with the corresponding 2.9-km recording. Coda-wave amplification is in good agreement with the direct wave at the rock site, but at the borehole, the coda-wave amplification factor overestimates the direct-wave amplification by a factor of 3.