In response to carbon dioxide (CO2) emissions, numerous studies have investigated the link between CO2 emissions and urban structures, and pursued low-carbon development from the standpoint of urban spatial planning. However, most of previous efforts only focused on urban structures in term of two-dimensional space, whereas the vertical influence of urban buildings (three-dimensional space) plays an important role in CO2 emissions. To address this issue, we took the cities in mainland China as study case to quantitatively explore how the three-dimensional urban structure affects CO2 emissions. First, we collected the city-level CO2 emission data from a greenhouse gas emission dataset released by the China City Greenhouse Gas Working Group. Then, a series of spatial metrics were established to quantify three-dimensional urban structures based on urban building data derived from Baidu Map. On the strength of the Stochastic Impacts by Regression on Population, Affluence, and Technology (STIRPAT) model, an extended approach and ridge regression analysis were finally utilized to investigate the consequences of three-dimensional urban structures on CO2 emissions at the city level. The results indicate that the total building volume is the largest driving force accelerating CO2 emissions due to the massive consumption of energies for human activities during rapid urbanization. Besides, urban buildings with taller height and large heat dissipation area also have significant positive effects on promoting CO2 emissions. Although a compact coverage of urban buildings at a two-dimensional scale contributes to the reduction of CO2 emissions, urban structure characterized by an intense and congested pattern in three-dimensional space can lead to more CO2 emissions because of the adverse impacts from surrounding environment and traffic congestion. Additionally, an irregular pattern of three-dimensional urban structure would help reduce CO2 emissions to some extent. Such study results highlight the importance of urban planning for the development of a low-carbon city, and suggest the compact patterns of three-dimensional urban structures should be controlled within a reasonable range to avoid more CO2 emissions caused by excessive centralization and aggregation.