Magnesium alloys have great potential for developing orthopedic implants due to their biodegradability and mechanical properties, but the rapid corrosion rate of the currently-available alloys limits their clinical applications. To increase the corrosion resistance of the substrate, a protective ceramic coating is constructed by a micro-arc oxidation (MAO) process on ZK60 magnesium alloy. The porous ceramic coating is mainly composed of magnesium oxide and magnesium silicate, and the results from cell cultures show it can stimulate osteoblastic cell growth and proliferation. Moreover, gallic acid, a phenolic compound, was successfully introduced onto the MAO coating by grafting on hydrated oxide and chelating with magnesium ions. The gallic acid and rough surface of MAO altered the cell attachment behavior, making it difficult for fibroblasts to adhere to the MAO coating. The viability tests showed that gallic acid could suppress fibroblast growth and stimulate osteoblastic cell proliferation. Overall, the porous MAO coating combined with gallic acid offered a novel strategy for increasing osteocompatibility.