A bioerodible endoprosthesis includes a bioerodible magnesium alloy. The bioerodible magnesium alloy has a microstructure including equiaxed Mg-rich solid solution-phase grains having an average grain diameter of less than or equal to 5 microns and second-phase precipitates in grain boundaries between the equiaxed Mg-rich solid solution-phase grains. The beta-phase precipitates have an average longest dimension of 0.5 micron or less. The microstructure can be produced by one or more equal-channel high-strain processes.