We investigate the influence of impacts of large planetesimals and small planetary embryos on the early Martian surface on the hydrodynamic escape of an early steam atmosphere that is exposed to the high soft X-ray and EUV flux of the young Sun. Impact statistics in terms of number, masses, velocities, and angles of asteroid impacts onto the early Mars are determined via n-body integrations. Based on these statistics, smoothed particle hydrodynamics (SPH) simulations result in estimates of energy transfer into the planetary surface material and according surface heating. For the estimation of the atmospheric escape rates we applied a soft X-ray and EUV absorption model and a 1-D upper atmosphere hydrodynamic model to a magma ocean-related catastrophically outgassed steam atmosphere with surface pressure values of 52 bar H2O and 11 bar CO2. The estimated impact rates and energy deposition onto an early Martian surface can account for substantial heating. The energy influx and conversion rate into internal energy is most likely sufficient to keep a shallow magma ocean liquid for an extended period of time. Higher surface temperatures keep the outgassed steam atmosphere longer in vapor form and therefore enhance its escape to space within about 0.6 Myr after its formation.