The role of fibroblast growth factor 9 (FGF9) in bone formation may depend on gene dosage, developmental stage, cell type or interactions with other cytokines. In the present study bone marrow stromal stem cells (BMSCs) and dental pulp stem cells (DPSCs) were cultured and osteogenically induced in vitro, treated with exogenous FGF9 at varying concentrations. Alkaline phosphatase staining, alizarin red S staining, reverse transcription quantitative polymerase chain reaction and western blot analyses were performed in order to investigate the gene expression levels of osteogenic markers. The results of the present study demonstrated that FGF9 enhanced the phosphorylation of extracellular signal‑regulated kinase 1/2 (ERK1/2) during osteogenic induction in BMSCs and DPSCs, which are derived from different tissues. FGF9 also inhibited the osteogenic differentiation of BMSCs and DPSCs through the activation of ERK1/2. These findings suggested that FGF9 may be an inhibitor of osteogenesis in mesenchymal stem cells in vitro and its application in vivo requires investigation in the future.