In this paper, the conversion of refinery furnaces’ flue gas into gasoline through the MTG process is investigated. This approach not only reduces greenhouse gas emissions, but also produces a high-value product, providing economic incentives to adopt this technology. The proposed integrated system comprises an organic Rankine cycle, an amine-based carbon capture unit, a methanol synthesis unit, and an MTG unit. In this study, we evaluated the technical and economic aspects of this conversion process, including the thermodynamic and cost analysis, to assess its viability as a sustainable solution for mitigating CO2 emissions from refineries. Also, using response surface methodology combined with the Box-Behnken design, the proposed integrated system was optimized to minimize the gasoline production cost. The thermodynamic assessment concludes that the energy and exergy efficiencies of the overall system are 73.12% and 85.24%, respectively. The proposed system yields an annual gasoline production rate of >184 million liters. The estimated total capital investment for the proposed system is 172.16 M$, which the methanol synthesis unit with a share of 48.65% is the most expensive one. The results give a gasoline production cost of 1.58 $/kg or 4.28 $/gal for the optimized case. Also, hydrogen has the highest contribution in the production cost, so with a 20% decrease in the price of hydrogen, the production cost of gasoline decreases by 18.71%. With this rate of technological improvement, reductions in the price of hydrogen seem inevitable in not-so-distant years, which makes the proposed system of converting refinery furnaces’ flue gas into gasoline became desirable.