The invention relates to a magnesium alloy which comprises:Zn: 0.5-2 wt %,Mn: 0.2-1 wt %,Ca: 0.1-2 wt %,wherein the magnesium alloy comprises0.6 wt % or more Mn or0.6 wt % or more Ca,between 0.5 wt % and 1.5 wt % Mn and Ca in sum,and wherein Mg and impurities account for the remaining content in the alloy that is missing up to 100 wt %. The invention further relates to an implant of a calcium containing magnesium alloy, which is coated with a calcium phosphate layer. The invention further relates to a method of producing a biodegradable implant.