  We have undertaken an extensive study of X-ray data from the accreting
millisecond pulsar XTE J1751-305 observed by RXTE and XMM-Newton during its
2002 outburst. In all aspects this source is similar to a prototypical
millisecond pulsar SAX J1808.4-3658, except for the higher peak luminosity of
13 per cent of Eddington, and the optical depth of the hard X-ray source larger
by factor ~2. Its broad-band X-ray spectrum can be modelled by three
components. We interpret the two soft components as thermal emission from a
colder (kT ~ 0.6 keV) accretion disc and a hotter (~1 keV) spot on the neutron
star surface. We interpret the hard component as thermal Comptonization in
plasma of temperature ~40 keV and optical depth of ~1.5 in a slab geometry. The
plasma is heated by the accretion shock as the material collimated by the
magnetic field impacts on to the surface. The seed photons for Comptonization
are provided by the hotspot, not by the disc. The Compton reflection is weak
and the disc is probably truncated into an optically thin flow above the
magnetospheric radius. Rotation of the emission region with the star creates an
almost sinusoidal pulse profile with rms amplitude of 3.3 per cent. The
energy-dependent soft phase lags can be modelled by two pulsating components
shifted in phase, which is naturally explained by a different character of
emission of the optically thick spot and optically thin shock combined with the
action of the Doppler boosting.
