DUBAI - Saudi Arabia has registered a budget surplus of nearly 78 billion riyals ($21 billion) in the second quarter of 2022, the finance ministry said on Thursday, an almost 50% rise from a year earlier, bolstered by high oil prices.

Revenue in the second quarter reached 370.37 billion riyals and expenditure was 292.46 billion, the ministry said.

"A widening in the fiscal surplus was expected in 2Q with the higher oil price and production level," said Monica Malik, chief economist at Abu Dhabi Commercial Bank. "Government spending strengthened, though (it) still remains broadly in line with the budget plans."

Saudi Arabia has pledged to "decouple" state spending from oil price fluctuations. Its expected surplus for 2022 - which would be its first in nearly a decade - will sit in the government's current account until the government's finance committee decides how to allocate it, likely early next year.

Finance Minister Mohammed al-Jadaan told Reuters in May the surplus could go towards the Public Investment Fund (PIF), Saudi Arabia's $600 billion sovereign wealth fund, and the National Development Fund (NDF).

The excess may also go to foreign reserves at the central bank. As part of a fiscal sustainability policy, the kingdom is in the final stages of determining a floor and ceiling for reserves, as a percentage of GDP.

Oil revenue was 250.36 billion riyals, an 89% surge compared with a year before, the ministry said. That was equivalent to just over two thirds of total government revenue, while non-oil revenue was 120.00 billion riyals, a 3% increase.

The kingdom posted a first-quarter surplus of more than $15.3 billion riyals.

Spending in the first half of 2022 was up 10% compared with the first half of last year, while revenue jumped 43%, the finance ministry said.

At the end of June, the government had reserves of 318.65 billion riyals and a current account surplus of 131.45 billion.

Domestic debt rose to 604.76 billion riyals at the end of June from 558.75 at the end of 2021. External debt was down to 361.76 billion riyals from 379.26 billion in the same period.

(Reporting by Yousef Saba and Nadine Awadalla in Dubai, and Enas Alashray and Yomna Ehab in Cairo; Editing by Alison Williams and David Holmes)