During the observation period 1997, the nearby blazar Mrk 501 showed extrem
ely strong emission and high variability. We examine multiwavelength aspect
s of this event using radio, optical, soft and hard X-ray, and TeV data. We
concentrate on the medium-timescale variability of the broadband spectra,
averaged over weekly intervals. We confirm the previously found correlation
between soft and hard X-ray emission and the emission at TeV energies, whi
le the source shows only minor variability at radio and optical wavelengths
. The nonlinear correlation between hard X-ray and TeV fluxes is consistent
with a simple analytic estimate based on an SSC model in which Klein-Nishi
na effects are important for the highest-energy electrons in the jet, and f
lux variations are caused by variations of the electron density and/or the
spectral index of the electron injection spectrum. The time-averaged spectr
a are fitted with a synchrotron self-Compton (SSC) dominated leptonic jet m
odel, using the full Klein-Nishina cross section and following the self-con
sistent evolution of relativistic particles along the jet, accounting for y
y absorption and pair production within the source as well as due to the in
tergalactic infrared background radiation. The contribution from external i
nverse-Compton scattering is tightly constrained by the low maximum EGRET f
lux and found to be negligible at TeV energies. We find that high levels of
the X-ray and TeV fluxes can be explained by a hardening of the energy spe
ctra of electrons injected at the base of the jet, in remarkable contrast t
o the trend found for gamma-ray flares of the flat-spectrum radio quasar PK
S 0528 + 134.