We present a detailed numerical study of the equilibrium and nonequilibrium dynamics of the phase transition in the finite-temperature Abelian Higgs model. Our simulations use classical equations of motion both with and without hard-thermal-loop corrections, which take into account the leading quantum effects. From the equilibrium real-time correlators, we determine the plasmon frequency, the plasmon damping rate and the Landau damping rate, finding significant nonperturbative effects in the last two quantities. We also find that, close to the phase transition, the static magnetic field correlator shows power-law magnetic screening at long distances. The information about the damping rates allows us to derive a quantitative prediction for the number density of topological defects formed in a phase transition. We test this prediction in a nonequilibrium simulation and show that the relevant time scale for defect formation is given by the Landau damping rate.