Oil and gas giant Saudi Aramco officially has the largest initial public offering (IPO) in history. The company managed to raise a whopping $25.6 billion in its IPO after selling its shares in Saudi Arabia.

The company managed to sell all of its 3 billion shares at around $8.53 a piece. The total amount that it raised in its IPO overtook the previous record holder, Alibaba Group, during its public debut in the United States in 2014.

At the price its shares were sold, the IPO values Saudi Aramco at around $1.7 trillion, landing it the title of the most valuable publicly traded company in the world. The company's market valuation overtook Apple, which is currently worth around $1.15 trillion.

Despite its staggering market valuation, the figure still fell short of Saudi Crown Prince Mohammed bin Salman's $2 trillion valuation expectation. The Crown Prince first touted the idea of a public listing back in 2016 as part of its grand economic liberalization plan for Saudi Arabia.

Saudi Aramco could potentially increase its IPO size if it chooses to sell more shares under it's listing's Green Shoe over-allotment option. If it does decide to sell more shares, its IPO could reach as much as $29.4 billion. Prior to its listing, Saudi Aramco did mention that it only plans to sell around 1.5 percent of 200 billion shares.

Demand in the company's stocks was mainly fueled by its promise of paying an annual dividend of $75 billion up to 2024. Heavy investors in the stocks included sovereign wealth funds, Chinese investors, and rich Saudi nationals.

Saudi Arabia plans to use the capital it had raised from the IPO to fund Crown Prince Bin Salman's Vision 2030. The initiative aims to diversify the kingdom's revenue sources away from oil by developing other sectors within its economy. The IPO is also the kingdom's way of signaling foreign investors that it is now open for business.

In 2018, Saudi Arabia initially planned to sell up to 5 percent of its stake. This would have resulted in an IPO worth around $100 billion at current prices. The kingdom was initially considering a listing in overseas exchanges such as in New York and London.

Due to various factors, including legal complications, if it listed overseas, Saudi Arabia decided to shelve its IPO plans. The decision was also made amid doubts of its expected $2 trillion valuations. Earlier in the year, the kingdom revived its IPO plans citing more favorable market conditions.

Saudi Aramco did launch an international bond sale, but the amount of interest in the sale was less than expected. Analysts mostly attributed the lack of interest to lower oil prices, geopolitical risks, and the ongoing climate crisis.