Osteosarcoma is a malignant primary bone tumor, which often associates with pulmonary metastasis. The radical surgery of osteosarcoma often requires internal orthopedic implants. Therefore, implants with antitumor properties should be developed. Magnesium (Mg) and its alloys possess great potential as orthopedic materials, given their biodegradable properties, superior osteogenesis performance, and antitumor features. However, problems arise with their uncontrolled degradation rates and their unknown antitumor mechanisms. In our study, when compared with pure Mg, the rare element silver alloyed with yttrium (Ag–Y) could extremely enhance the corrosion resistance of these elements, giving the Ex–Mg–1Ag–1Y alloy better anticorrosion rates. Here, we implanted the Ex–Mg–1Ag–1Y alloy and pure Mg and Ti alloy in vivo around tumors in nude mice (BALB/c). Notably, the local tumor weight in Mg alloy and pure Mg groups were much smaller than that in Ti alloy group in 36 days after surgery (6.59 ± 0.70, 6.76 ± 0.62, and 8.54 ± 0.56 g), while the general scores of lung metastasis in Mg alloy and pure Mg groups were also lower than Ti alloy group (64.50 ± 7.64, 62.73 ± 7.84, and 87.60 ± 9.43). Therefore, the Mg and Ex–Mg–1Ag–1Y alloy, both demonstrated resisting effects against local tumor growth and pulmonary metastasis, which could be performed by changing the extracellular acidosis microenvironment, elevating the Mg concentration, suppressing C–X–C chemokine receptor type 4 (CXCR4) levels, and increasing prostacyclin (PGI2) synthesis. Our work revealed that the Ex–Mg–1Ag–1Y alloy may be a promising orthopedic implant for treating osteosarcoma due to its better corrosion resistance and antitumor attributes. © 2019 Wiley Periodicals, Inc. J Biomed Mater Res Part B: Appl Biomater 107B:2537–2548, 2019.