While most CNS glia arise from neuroectodermal progenitors, some, like microglia, are mesodermally derived. To understand mesodermal glia development and function, we investigated C. elegans GLR glia, which ensheath the brain neuropil and separate it from the circulatory-system cavity. Transcriptome analysis suggests GLR glia merge astrocytic and endothelial characteristics relegated to separate cell types in vertebrates. Combined fate acquisition is orchestrated by LET-381/FoxF, a fate-specification/maintenance transcription factor expressed in glia and endothelia of other animals. Among LET-381/FoxF targets, UNC-30/Pitx2 transcription factor controls GLR glia morphology and represses alternative mesodermal fates. LET-381 and UNC-30 co-expression in naive cells is sufficient for GLR glia gene expression. GLR glia inactivation by ablation or let-381 mutation disrupts locomotory behavior and induces salt hypersensitivity, suggesting brain-neuropil activity dysregulation. Our studies uncover mechanisms of mesodermal glia development and show that like neurons, glia differentiation requires autoregulatory terminal selector genes that define and maintain the glial fate.