Jeff Bezos saved a small fortune by selling billions of dollars in Amazon shares before the coronavirus pandemic crashed the stock market, a new report said.

The 56-year-old e-commerce tycoon avoided about $317 million in paper losses by dumping $3.4 billion worth of Amazon stock in early February — less than three weeks before global markets tanked as the virus spread around the world, a Wall Street Journal analysis found.

Bezos would have taken that hefty hit had he kept the Amazon shares through March 20, according to the paper’s Tuesday report. The company’s stock price closed at $1,846.09 that day, down 8 percent from Jan. 31.

It’s uncertain what role, if any, the coronavirus played in Bezos’ decision to sell about 3 percent of his Amazon stake before the crisis became a pandemic that has effectively kneecapped the world economy.

Bezos said in 2017 that he would sell at least $1 billion in stock each year to fund Blue Origin, his private aerospace company. His latest round of selling also came after Amazon delivered an expectations-beating Jan. 30 earnings report that sent its market value above $1 trillion.

Amazon declined to comment on the Journal’s analysis.

Bezos is among many US corporate honchos who collectively dumped about $9.2 billion in stock between Feb. 1 and March 19, allowing them to avoid $1.9 billion in potential losses as the broader market tanked, the WSJ found by examining more than 4,000 regulatory filings. The paper noted that there’s “no suggestion” the executives made the trades based on insider information.

The period reportedly saw an uptick in selling among company insiders as the S&P 500 index plunged about 30 percent from its peak. Corporate officers sold roughly $6.4 billion in shares during the same time frame last year, according to the Journal.

Bezos has maintained his title as the world’s richest man amid the recent market downturn. His net worth has grown more than $2.3 billion so far this year to reach $117 billion as of Monday, according to Bloomberg’s Billionaires Index.