The relativistic transport model, in which the nucleon effective mass is connected to the scalar field while its energy is shifted by the vector potential, is extended to include the kaon degree of freedom. We further take into account the medium modification of the kaon mass due to the explicit chiral symmetry breaking. Both the propagation of kaons in the mean-field potential and the kaon-baryon elastic scattering are explicitly treated in our study. We find that the attractive kaon scalar mean-field potential in the dense matter leads to an enhanced kaon yield in heavy-ion collisions at energies of about 1 GeV/nucleon. The final-state kaon-baryon scattering is seen to affect significantly the kaon momentum spectra, leading to an enhanced yield of kaons with large momenta or at large laboratory angles. With a soft nuclear equation of state and including the attractive kaon scalar potential, the calculated kaon energy spectra agree with the data from the heavy-ion synchrotron at GSI.