In this study, bioglass–ceramic coatings were prepared on magnesium alloy substrates through sol–gel dip-coating route followed by heat treatment at the temperature range of 350–500°C. Structure evolution, bond strength and corrosion resistance of samples were studied. It was shown that increasing heat treatment temperature resulted in denser coating structure as well as increased interfacial residual stress. A failure mode transition from cohesive to adhesive combined with a maximum on the measured bond strength together suggested that heat treatment enhanced the cohesion strength of coating on the one hand, while deteriorated the adhesion strength of coating/substrate on the other, thus leading to the highest bond strength of 27.0MPa for the sample heat-treated at 450°C. This sample also exhibited the best corrosion resistance. Electrochemical tests revealed that relative dense coating matrix and good interfacial adhesion can effectively retard the penetration of simulated body fluid through the coating, thus providing excellent protection for the underlying magnesium alloy.