London (CNN Business) Saudi Aramco shares zoomed higher on Thursday, turning the massive state oil producer into the world's first $2 trillion company and achieving the valuation long sought by Crown Prince Mohammed bin Salman.

The stock gained 10% for a second consecutive day, reaching 38.70 riyals ($10.32) per share before giving up some of its gains.

Saudi Aramco has gained roughly $300 billion in value since its shares debuted on the Riyadh stock exchange on Monday in the biggest initial public offering on record . It's by far the most valuable company in the world, dwarfing runner up Apple, which is worth around $1.2 trillion.

The vast majority of buyers for the stock are in Saudi Arabia. Samba Capital, which managed the IPO, said Tuesday that 97% of retail investors who received shares were from the country. And more than 75% of shares sold to institutional investors went to Saudi companies, funds and government institutions.

The $2 trillion valuation was a priority for the crown prince ever since he first touted the partial privatization in 2016, but many analysts considered the figure a stretch despite Aramco's monopoly on oil production in Saudi Arabia, the world's largest exporter of crude.

Read More