While prokaryote community diversity and function have been extensively studied in soils and sediments, the functional role of fungi, despite their huge diversity, is widely unexplored. Several studies have, nonetheless, revealed the importance of fungi in provisioning services to prokaryote communities. Here, we hypothesise that the fungal community plays a key role in coordinating entire microbial communities by controlling the structure of functional networks in sediment. We selected a sediment environment with high niche diversity due to prevalent macrofaunal bioturbation, namely intertidal mangrove sediment, and explored the assembly of bacteria, archaea and fungi in different sediment niches, which we characterised by biogeochemical analysis, around the burrow of a herbivorous crab. We detected a high level of heterogeneity in sediment biogeochemical conditions, and diverse niches harboured distinct communities of bacteria, fungi and archaea. Saprotrophic fungi were a pivotal component of microbial networks throughout and we invariably found fungi to act as keystone species in all the examined niches and possibly acting synergistically with other environmental variables to determine the overall microbial community structure. In consideration of the importance of microbial-based nutrient cycling on overall sediment ecosystem functioning, we underline that the fungal microbiome and its role in the functional interactome cannot be overlooked.