Norway's sovereign wealth fund, the largest in the world, posted a gain of $84 billion in the first quarter due to the strong stock market following big losses last year, the central bank said Friday.

The robust showing, representing a return of 5.9 percent, erases about half of the fund's massive $165.4-billion loss last year amid turbulence over the start of the war in Ukraine.

The fund, one of the world's biggest investors, was worth a dizzying $1.34 trillion at the end of March, or almost $245,000 for each of Norway's 5.5 million inhabitants.

"The equity investments had the most positive contribution to the return in the quarter," the fund's deputy director Trond Grande said in a statement.

"The rise of the equity market was to a great extent driven by the technology and consumer discretionary sector," he added.

Fuelled by revenues from Norway's state-owned oil and gas companies, the fund is aimed at financing future spending in the generous welfare state.

According to a ranking by the Sovereign Wealth Fund Institute (SWFI), the Norwegian fund is the biggest in the world, just ahead of the China Investment Corporation and followed by those in Abu Dhabi, Kuwait and Singapore.

Shares, which accounted for 70.1 percent of the Norwegian fund's portfolio at the end of March, saw a 7.4 percent return in the first quarter.

The fund has stakes in more than 9,200 companies worldwide, representing 1.5 percent of the total market capitalisation.

Bond investments, representing 27.3 percent of assets, gained 2.7 percent in the period.

Real estate holdings and those in unlisted renewable energy projects, which accounted for 2.4 and 0.1 percent, respectively, fell one percent and 3.8 percent.