The phonon echo excited by radio-frequency pulses in superconducting MgB 2 in external magnetic field was studied. Using the echo technique two contributions to ultrasound attenuation are observed: low-temperature relaxation, which depends on the magnetic field, and a decay connected to the superconducting energy gap at temperatures close to Tc. The value of about 7kBTc for the energy gap was extracted from the experimental data.