Conventional ultrafine grains can generate high-strength Mg alloys, but non-equilibrium grain boundaries deteriorates their corrosion resistance. Here, the authors present ultrafine grained Mg alloys with dense twins that display high strength and reduced corrosion rate by one order of magnitude.