We studied the attenuation of local and regional earthquake body waves recorded by the seismic network of northeastern Sonora, Mexico (Red Sísmica del Noreste de Sonora [RESNES]). The source-station paths of the selected data set cover the epicentral region of the May 1887 (Mw 7.5) Sonora earthquake. We used the best-located earthquakes recorded by RESNES between 2003 and 2004 to analyze the spectral amplitude decay of body waves with hypocentral distance. The database consists of 44 earthquakes with magnitudes between 1.8 and 3.2 and hypocentral distances between 25 and 150 km. We calculated Fourier spectral amplitudes from more than 400 records and defined attenuation functions with a nonparametric model by inverting the observed spectral amplitudes at 23 individual frequencies between 0.4 and 63.1 Hz. We determined regional attenuation curves based on events located more than 100 km northwest of the center of the network and local curves based on earthquakes located near the fault zone that ruptured in the 1887 earthquake. The obtained attenuation curves indicate that the spectral amplitudes decay faster in the area of the 1887 rupture than in the surrounding region. To analyze the possible sources of attenuation, we parameterized the attenuation functions considering three terms: one that accounts for geometrical spreading, another one for anelastic attenuation, and a third for near-surface attenuation. We found the S-wave quality factor Q to be similar in both the general region and near the 1887 rupture. However, in the region of the 1887 rupture, the near-surface attenuation exceeds the regional average. Finally, in the region of the 1887 rupture, the nonparametric attenuation functions and the estimates of Q indicate that at between 0.6 and 63.1 Hz, P waves attenuate more than S waves (QP=20.8f1.1, whereas QS=83.8f0.9).