The present disclosure is directed, at least in part, to a method of producing ceramic layers on magnesium and its alloys, a magnesium implant with a ceramic layer made by the method, and a magnesium implant having a biocompatible ceramic layer substantially free of material which impairs the biocompatibility of said biocompatible ceramic layer. In an exemplary embodiment, the method of producing ceramic layers on magnesium and its alloys, includes (a) immersing an implant and a metal sheet into the aqueous electrolyte bath, said aqueous electrolyte bath including: ammoniac, diammonium hydrogen phosphate and urea, and wherein the implant is made of magnesium or its alloy; (b) performing a anodic oxidation by passing a current between the implant, the metal sheet and through the aqueous electrolyte bath, wherein the implant is connected to a positive pole of a current source and the metal sheet is connected to a negative pole of the current source; (c) applying a current density selected to form sparks on said implant, to thereby form a ceramic layer on said implant.本揭露至少一部分係關於在鎂及其合金上製造陶瓷層之方法、以該方法製造之具有陶瓷層的鎂植入物、以及具有生物相容性陶瓷層鎂植入物,其實質上不含有損於該生物相容性陶瓷層之生物相容性的物質。在一示例性實施態樣中,在鎂及其合金上製造陶瓷層之方法包括(a)將植入物及金屬片浸入水性電解質浴,該水性電解質浴包括:氨、磷酸氫二銨及尿素,且其中該植入物係由鎂或其合金所製成;(b)藉由將該植入物、該金屬片及透過該水性電解質浴之間通電流,進行陽極氧化,其中該植入物接在電流來源的正極,且該金屬片接在電流來源的負極;(c)施以電流密度,其經選擇以在該植入物上形成火花,以藉此在該植入物上形成陶瓷層。