To prevent the worst impacts of climate change, Nature-Based Solutions (NBSs), by maintaining and creating Urban Green Infrastructures (UGIs), can be used. Urban agriculture, as a UGI, is widely accepted as an NBS by providing a wide range of ecosystem services (ES), including Food production, wildlife Habitat, a sense of place and Educational opportunities, Nitrogen fixation, Flood reduction, Improving water quality, Local climate regulation, and Carbon storage and sequestration. This study aimed to investigate the potential of carbon storage and sequestration ES by urban agriculture (croplands) in the Hamadan urban area. First, the UGI map was prepared, and agricultural lands were extracted. Then, a stratified random sampling was used (120 sampling points). Soil sampling (plot 1×1 m), at a depth of 0–30 cm, was conducted, dried (at 105 ° C/48 hours), and analyzed for total carbon content by dry combustion method (550°C/2 hours). Grass and litter samples were harvested (plot 1×1 m), oven-dried (at 65 ° C/48 hours), and heated (at 115°C/24 hours). The results showed that the average carbon sequestration potential by soil, grass cover, and litter was 104.88, 4.96, and 0.27 t/ha, respectively. Potato (181 t/ha) and corn (58.8 t/ha) cultivation had the highest and lowest soil carbon sequestration values, respectively. Also, Flax grass cover has the highest carbon sequestration potential (14.33 t/ha), and tomato plants as a grass cover have the lowest potential (0.3 t/ha). The highest potential of carbon sequestration from the point of view of total soil and grass cover is for potato, flax, garlic, vegetable, abandoned, pea, fallow, wheat, tomato, cucumber, rapeseed, and corn, respectively. Finally, it can be concluded that urban agriculture can be an NBS for providing carbon sequestration ES.