Ecological restoration of degraded riparian Tugai forests is a key driver to combat desertification in arid regions. Previous studies have focused mainly on changes in groundwater as the underlying mechanisms of Tugai forest's decline. We evaluated species composition and diversity of Tugai forest and their relationship to groundwater, soil salinity, and soil nutrient. Using 73 quadrats (100 m × 100 m) from 13 transects located perpendicularly to river in the upper reaches of the Tarim River. Eighteen plant species belonging to sixteen genera and eight families were recorded, and the dominant species included Populus euphratica, Phragmites communis, and Tamarix ramosissima. Three P. euphratica stand ages were detected: young stand, mature stand, and old stand. There were significant differences in species diversity, groundwater depth, groundwater salinity, distance from the quadrat to the river channel, soil moisture content, pH, electrical conductivity, total salt, Cl − , SO 4 2− , Ca 2− , Mg 2+ , Na + , K + , soil organic carbon, and soil organic matter across the stand ages. Seven species were identified as indicators of the three stand ages. Redundancy analysis indicated that the Tugai forest diversity indices were negatively correlated with groundwater depth, groundwater salinity, and distance from the river, and positively associated with electrical conductivity, total salt, pH, Cl − , SO 4 2− , CO 3 2− , soil organic matter, soil organic carbon, and soil moisture content. Plant diversity was the highest at 3-6 m groundwater depth, followed by 0-3 m and then 6-9 m, with the lowest recorded at > 9 m. The appropriate groundwater depth for herbs was about 1-4 m, whereas the depth for trees and shrubs was about 3-6 m. The groundwater depth < 6 m was deemed suitable for the growth of desert riparian forests. This results provide a scientific reference for the ecological restoration and protection for Tugai forests in arid areas.