This study develops an integrated analytical framework, based on LMDI method, to identify the driving factors of energy and water (EW) nexus in Beijing from both economy- and sector-wide perspectives. The notable findings are: (1) The service and urban household sectors contributed most to the increase of energy use while the agriculture sector played a dominated role in the large decline of water use in Beijing from 2002 to 2017. Service and urban household were the key sectors of EW nexus. (2) Both economy- and sector-wide factors exerted synergistic effects on EW use, although their contributions to water-saving were much higher than energy-saving. Regarding economy-wide factors, production expansion considerably increased both EW use in Beijing, with the contribution degrees of 129.9% and 276.2%, respectively, and population expansion also played an important role in increasing EW use, with the contribution degree of 10.3% and 32.9%; while efficiency improvement and industrial structure adjustment led to much more water-saving of 261.7% and 145.1% than energy-saving of 56.6% and 5.6%, respectively. As to sector-wide factors, production expansion of industry and service sectors, and income improvement of urban household contributed to a considerable increase in both energy and water use, and the contribution degree are 58.3%, 65.7% and 28.5% for energy use as well as 61.0%, 79.8% and 22.8% for water use, respectively, whereas efficiency improvement of industry sector effectively curbed the increase of energy and water use, with the contribution degree of -50.5% and -76.7%, respectively. (3) The only trade-off between energy- and water-saving occurred in the efficiency improvement of the agriculture sector. (4) More attention should be paid to reducing EW use in the service and urban household sectors through efficiency improvement and behavior guidance for EW saving.