While urbanisation contributes to global biodiversity declines, flower-rich urban habitats may provide beneficial pollinator habitats. We investigated the potential of urban residential areas to contribute to pollinator diversity by analysing wild bee and hoverfly species richness and composition of species assemblages of summer-active species, sampled in 53 gardens across urban and rural landscapes of Malmö, the regional capital of Sweden’s southernmost county. Species richness differed between urban and rural gardens, and between four urban residential types (ranging from low human density and high vegetation cover, to high human density and low vegetation cover), and taxonomic groups responded differently. Solitary bee species richness was higher in urban than rural gardens, driven by a higher richness in low-density urban gardens compared to both high-density urban gardens and rural gardens. In contrast, bumblebee species richness was higher in rural than urban gardens, whereas differences among the urban types were less clear. Hoverfly species richness was consistently higher in rural gardens than any urban garden type. Species richness of all groups was negatively related to human population density at the landscape scale (radius 500 m), but unrelated to vegetation cover. This indicates that population density affects pollinator habitat quality through associated green space management and design. Rural and urban wild bee species assemblages consisted of different species (significant species turnover), whereas urban hoverfly assemblages were a subset of rural ones (significant nestedness). Species nestedness of hoverflies, but not bees, increased with human population density. We show that urban areas can complement the regional wild bee species pool, mainly caused by large variation in tenure and management at small spatial scales, while urbanisation drives a systematic loss of hoverfly species. We suggest alternatives to improve dense residential areas for pollinators.