Magnesium-based materials are preferred in temporary orthopedic implants because of their biodegradability, mechanical properties, and intrinsic antibacterial properties. However, the fundamental mechanism of bacteria killing and roles of various factors are not clearly understood. In this study, we performed a systematic study of the antibacterial properties of two common Mg-based materials using a biofilm forming bacterium. Complete annihilation of the initial 3 × 10(4) bacteria is achieved with both materials in 0.1 mL LB medium in 24 h, whereas in the control, they proliferate to 10(10). The bacteria are killed more effectively in the solution than on the surface, and the bacteria killing efficiency depends more on the concentrations of the magnesium ions and hydroxyl ions than the corrosion rate. The killing process is reproduced using formula solutions, and killing is revealed to stem from the synergetic effects of alkalinity and magnesium ions instead of either one of them or Mg(OH)2 precipitate. Reactive oxygen species (ROS) are detected from the bacteria during the killing process but are not likely produced by the redox reaction directly, because they are detected at least 3 h after the reaction has commenced. The average cell size increases during the killing process, suggesting that the bacteria have difficulty with normal division which also contributes to the reduced bacteria population.