(Adds details, background)
RIYADH, July 2 (Reuters) - Aramco Overseas Co (AOC), a unit of state-run oil giant Saudi Aramco, said on Wednesday it had agreed in principle to buy Hanjin Group's 28.4 percent stake in South Korean refiner S-Oil Corp for about $1.95 billion.
The purchase will increase AOC's ownership of S-Oil to 63.4 percent from 34.99 percent, AOC said in a statement.
Korean Air Lines Co said earlier on Wednesday that its Hanjin Energy Co unit would sell its stake in S-Oil for 1.98 trillion Korean won ($1.96 billion) to improve the financial position of the parent firm.
"This transaction underscores Saudi Aramco's confidence in the Korean economy and its strategy to enhance its presence in the growing Asian markets and AOC's commitment to S-OIL growth." Khalid al-Falih, Aramco's chief executive, said in a statement.
According to Aramco's 2013 annual review, the company and its subsidiaries own or have equity interest in refineries with a total worldwide refining capacity of 4.9 million barrels per day (bpd), of which its equity share is 2.6 million bpd, making it the world's sixth-largest refiner.
Aramco has said its downstream investments would exceed $100 billion over the next decade, as global demand for oil rises by an expected quarter in the next 25 years.
The sale by Korean Air comes as it tries to pay off debt and support loss-making affiliate Hanjin Shipping Co Ltd .
The flag carrier's debts rose last year after investing in fuel-efficient planes, while South Korea's largest shipping line has suffered falling margins in a sluggish market as well as a big foreign exchange loss.
Hanjin Group, the parent firm of Korean Air Lines, sold some of the assets of Hanjin Shipping for 1.6 trillion won in the first half of this year.
$1 = 1009.1000 South Korean Won Reporting by Angus McDowall in Riyadh and Hyunjoo Jin and Meeyoung Cho in Seoul; Writing by Rania El Gamal; Editing by Mark Potter