The presentation will focus on the development of a refinery-wide closed-loop real-time optimization (RTO) system at the Saudi Aramco’s Yanbu Refinery initiated as part of Saudi Aramco’s digital transformation initiative. This AVEVA Process Optimization (APO) system is the first of its kind in the Middle East. The RTO system closes the economic and technology gap between refinery planning requirements and real-time process operations. The system utilizes a comprehensive, rigorous process model of all refinery units to develop optimum refinery operating targets while considering current crude, product and utility pricing, process constraints, and the monthly refinery product handling and operating plan. In addition to APO, the system utilizes PI historian, visualization, and communication tools. The system was successfully commissioned in May 2022 with an accelerated project schedule of only 7 months. An initial estimate of economic benefits will result in a 3-6 month payback time.