This releases equity invested in the construction of the $10bn refinery, which did not secure project finance before construction.
Twenty-six local and international banks participated in the unsecured, seven-year syndicated loan.
The US dollar tranche totalled $3.1bn from 17 banks. It priced at 105 basis points over the London interbank offered rate (Libor), according to Reuters.
Nine local banks participated in the $1.6bn Saudi riyal tranche. It priced at 100 basis points over the Saudi interbank offered rate.
Aramco and Sinopec formed a joint venture, Yanbu Aramco Sinopec Refining Company (Yasref), to build the 400,000 barrel-a-day refinery. It was completed in 2014.
Aramco has a 62.5 per cent equity stake in Yasref, with Sinopec owning the remainder.
MEED reported in March that Aramco had not disclosed an adviser, and dealt directly with lenders.