Tumor-associated macrophages (TAMs) play an important role in the immune response to cancer, but the mechanisms by which the tumor microenvironment controls TAMs and T cell immunity are not completely understood. Here we report that kynurenine produced by glioblastoma cells activates aryl hydrocarbon receptor (AHR) in TAMs to modulate their function and T cell immunity. AHR promotes CCR2 expression, driving TAM recruitment in response to CCL2. AHR also drives the expression of KLF4 and suppresses NF-κB activation in TAMs. Finally, AHR drives the expression of the ectonucleotidase CD39 in TAMs, which promotes CD8+ T cell dysfunction by producing adenosine in cooperation with CD73. In humans, the expression of AHR and CD39 was highest in grade 4 glioma, and high AHR expression was associated with poor prognosis. In summary, AHR and CD39 expressed in TAMs participate in the regulation of the immune response in glioblastoma and constitute potential targets for immunotherapy.