Soil salinity is a global environmental issue that poses a serious threat to soil quality harming the terrestrial ecosystems, and the Songnen Plain in Northeast China exemplifies saline-alkaline soils. Alfalfa has played an important role in the improvement of saline and alkaline land in the Songnen Plain, which has significantly increased the agricultural production potential of saline and alkaline land. However, limited studies have investigated the specific effects of alfalfa on soil aggregate pore structure, microbial community composition, and soil carbon content, which are critical factors in soil restoration. Accordingly, using high-throughput sequencing and computed tomography (CT) to examine how alfalfa cropping impacts these key soil properties, specifically, soil aggregate porosity, microbial diversity, and soil organic carbon content. The findings revealed that cropping alfalfa significantly increased the porosity of the topsoil, especially the increase in macropores (P-> 100 mu m) was more pronounced. Topsoil organic carbon content and its carbon fractions were significantly increased, with soil organic carbon (SOC), mineral-associated organic carbon (MAOC), particulate organic carbon (POC), readily oxidizable carbon (ROC), and dissolved organic carbon (DOC) were all increased. Alfalfa cropping also enhanced microbial community structure, as evidenced by larger and more interconnected microbial co-occurrence networks. In the topsoil, the number of nodes increased by 787 and 803, while the number of edges grew by 1067 and 8186 in bacterial and fungal networks, respectively. Similarly, in the subsoil, bacterial and fungal networks exhibited increases of 1819 and 289 nodes, and 11,422 and 2372 edges, respectively. These complex networks demonstrated greater resilience to saline-alkaline stress, with keystone microbial species influenced by organic carbon fractions driving community assembly primarily through stochastic processes. The study also highlighted significant vertical spatial variability, with alfalfa cropping having a more pronounced effect on topsoil compared to subsoil. In addition, cropping alfalfa improved the physical and chemical properties of saline soils, enhanced soil aggregate stability, increased macropore proportions, boosted microbial diversity, and contributed to the ecological restoration of saline soils. These findings provide valuable insights into the mechanisms by which alfalfa improves saline soils and offer a promising approach for the restoration and sustainable management of saline-alkaline ecosystems.