Algal-bacterial granular sludge (ABGS) composed of microalgae and aerobic granular sludge, is a sustainable and promising technology for wastewater treatment. However, the formation mechanism of ABGS has not been clearly defined, and the direct formation of ABGS in saline wastewater has rarely been investigated. This study proposed novel insights into the granulation process of ABGS by assembling the algal barrier, which was successfully cultivated directly in saline wastewater. The results concluded that ABGS with the algal barrier maintained a higher biomass (MLSS of 7046 ± 61 mg/L), larger particle sizes (1.21 ± 0.06 mm), and better settleability (SVI30 of 46 ± 1 mL/g), enabling efficient pollutants removal. Soluble microbial products (SMP) were found to be closely related to the emergence of the algal barrier. In addition, under salinity stress, the high production of extracellular polymeric substances (EPS, 133.70 ± 1.40 mg/g VSS), specifically TB-EPS (90.29 ± 1.12 mg/g VSS), maintained a crucial role in the formation of ABGS. Further analysis indicated that biofilm producing bacteria Pseudofulvimonas and filamentous eukaryote Streptophyta were the key players in ABGS formation with the algal barrier. Furthermore, the enhancement of key genes and enzymes involved in nitrogen metabolism, TCA cycle, and polysaccharide metabolism suggested a more robust protective effect provided by the algal barrier. This study is expected to advance the application of simultaneous ABGS formation and pollutant removal in wastewater.