Résumé : Urbanization is one of the major anthropogenic processes contributing to local habitat loss and extirpation of numerous species, including wild bees, the most widespread pollinators. Little is known about the mechanisms through which urbanization impacts wild bee communities, or the types of urban green spaces that best promote their conservation in cities. The main objective of this study was to describe and compare wild bee community diversity, structure, and dynamics in two Canadian cities, Montreal and Quebec City. A second objective was to compare functional trait diversity among three habitat types (cemeteries, community gardens and urban parks) within each city. Bees were collected using pan traps and netting on the same 46 sites, multiple times, over the active season in 2012 and 2013. A total of 32,237 specimens were identified, representing 200 species and 6 families, including two new continental records, Hylaeus communis Nylander (1852) and Anthidium florentinum (Fabricius, 1775). Despite high community evenness, we found significant abundance of diverse species, including exotic ones. Spatio-temporal analysis showed higher stability in the most urbanized city (Montreal) but low nestedness of species assemblages among the three urban habitats in both cities. Our study demonstrates that cities are home to diverse communities of wild bees, but in turn affect bee community structure and dynamics. We also found that community gardens harbour high levels of functional trait diversity. Urban agriculture therefore contributes substantially to the provision of functionally diverse bee communities and possibly to urban pollination services.