This work aimed to investigate tumor-infiltrating immune cells (TIICs) and immune-associated genes in the tumor microenvironment of osteosarcoma. An algorithm known as ESTIMATE was applied for immune score assessment, and osteosarcoma cases were assigned to the high and low immune score groups. Immune-associated genes between these groups were compared, and an optimal immune-related risk model was built by Cox regression analyses. The deconvolution algorithm (referred to as CIBERSORT) was applied to assess 22 TIICs for their amounts in the osteosarcoma microenvironment. Osteosarcoma cases with high immune score had significantly improved outcome (P<0.01). The proportions of naive B cells and M0 macrophages were significantly lower in high immune score tissues compared with the low immune score group (P<0.05), while the amounts of M1 macrophages, M2 macrophages, and resting dendritic cells were significantly higher (P<0.05). Important immune-associated genes were determined to generate a prognostic model by Cox regression analysis. Interestingly, cases with high risk score had poor outcome (P<0.01). The areas under the curve (AUC) for the risk model in predicting 1, 3 and 5-year survival were 0.634, 0.781, and 0.809, respectively. Gene set enrichment analysis suggested immunosuppression in high-risk osteosarcoma patients, in association with poor outcome.