Saudi Arabia’s government has been spending billions of dollars to quietly prop up its stock market and counter selloffs that have followed repeated political crises in recent months.

According to a Wall Street Journal analysis of trading data and interviews with multiple people with direct knowledge of government intervention efforts, the Saudi government has placed huge buy orders, often in the closing minutes of negative trading days, to boost the market.

The Saudi stock market is a pillar of Crown Prince Mohammed bin Salman’s plan to revamp his country’s economy. Since he ascended to a top leadership position three years ago, the de facto Saudi ruler and his deputies have faced a series of foreign-relations predicaments—most recently the October murder of columnist Jamal Khashoggi—that prompted investors to dump Saudi stocks.

The Saudi stock exchange normally discloses how much stock the government buys. The recent purchases after political crises have been concealed from public view. That is because the government, rather than buying stock directly, has routed its money through asset managers at Saudi financial institutions who run funds that don’t need to reveal their clients, those people say.

The exchange continues to report on government stock buying, selling and ownership. The bulk of recent share purchases by the government aren’t included in those disclosures.