Energy efficiency improvement is an effective strategy for CO2 reduction as well as cost savings in the industrial sector. Petroleum refineries generate significant amounts of hot and wet flue gas containing CO2 given their large fuel consumption due to energy intensive processes. In addition, for those locations where the climate is arid, sustainable water supply turns out to be a serious problem to meet the large demand for steam. This paper proposes to synthesize an optimal heat and water recovery system (HWRS) using a superstructure based method to achieve CO2 reduction, cost savings, and water recovery all simultaneously. The water recovery rate is obtained using Aspen Plus (R) and the HEN is designed by formulating an MINLP problem and solving it using GAMS. As a result, the HWRS could achieve 4.348% CO2 reduction and 28 k$/day of cost savings with 29% lower water demand from the desalination plant. (C) 2019 Elsevier Ltd. All rights reserved.