Baseline ecological studies of pristine mangroves are important for monitoring, management and conservation of mangrove ecosystems. Diversity, density, biomass and community structure of crab and molluscan macrofauna were studied in a near-pristine mangrove forest in Sematan, Sarawak. In each of the nine 100-m2 plots, six 15-min catching periods were used to collect crabs and three 1-m2 quadrats were sampled for molluscan epifauna. Environmental variables and vegetation were also recorded in each 100-m2 plot. Thirty-one crab species and 44 molluscan species were recorded, including a few species not previously reported from Sarawak. Crab community structure was correlated with topographical height and surface water pH and salinity. Gastropod community structure was correlated with redox potential of water at depth, topographical height, surface water pH and leaf litter. Crab community structure and species number were positively correlated with tree and seedling community structure and diversity, suggesting that the mangrove vegetation is important to the crab fauna as a habitat and food supply. Molluscan abundance was positively correlated with sapling diversity and negatively correlated with the numbers of mangrove associates and tree species. The young leaves on mangrove saplings may provide a better food source than those on mature trees or mangrove associates. The data from this study provide a valuable baseline for future use at this site and for comparison with more degraded mangrove habitats elsewhere in South-East Asia.