Bezos' rise to No. 1 followed a surge in Amazon.com shares Thursday ahead of the online retailer's earnings report due out later in the day. The company's shares have been on a tear over the past year, passing the $1,000 mark and hitting $1,082 around noon on Thursday, propelling Bezos, 53, to $90.6 billion compared with Gates's $90.1 billion. Gates, 61, who built his fortune through Microsoft, has long been among the world's richest and had held the top spot since May 2013.

By midday, however, Amazon shares gave up much of the gain, and Gates reclaimed the top spot on Forbes magazine's real-time measure of the fortunes of the world's wealthiest people.

Amazon shares were down about 3 percent in after-hours trading Thursday after the retail giant reported that second-quarter profits fell short of expectations. The company posted $197 million in profit, or about 40 cents per share. That is down from $857 million a year ago, or $1.78 per share in profit. Analysts were expecting $.1.42 a share.

Revenue continues to soar, coming in at $38 billion. That was better than Wall Street's estimates of $37.2 billion, and far outstrips $30.4 billion in second quarter revenue a year ago.

Amazon's share price has gained about 40 percent, year to date.

"We can chalk the miss up to more fulfillment center and technology spending," said R.J. Hottovy, consumer equity strategist at Morningstar. "The technology is where a lot of spending is going, such as Amazon Web Services and Echo and other new products."

Amazon's market cap, which is the total value of all its shares, also broke the $500 billion mark recently, joining other exclusive members of the $500-billion-plus club such as Alphabet, Microsoft and Apple.

Often referred to as the "Everything Store," it has built on its online retail empire and pushed more heavily into groceries and apparel in recent quarters. Amazon Web Services, its cloud-computing unit with large government contracts, also accounts for a sizable portion of its profits.

A cornerstone of its success is its Prime membership program, in which shoppers pay $99 a year for unlimited two-day shipping on many purchase. Amazon does not disclose its number of Prime shoppers, but analysts estimate it is about 50 million. In February, Bezos said that "tens of millions of new paid members" had joined Prime in the past year.

Amazon's surprise announcement in June that it would buy Whole Foods, the purveyor of organics and healthy fare, for $13.7 billion is already rattling the grocery sector, with competitors' share prices dropping on the news.Ads by ZINC

Amazon's move to buy Whole Foods has raised the specter of antitrust issues. The United Food and Commercial Workers International Union has filed a complaint with the Federal Trade Commission arguing that the deal would trigger store closings, job losses and eventually wipe out competition and customer choice.

Michael A. Carrier, professor at Rutgers Law School specializing in antitrust, said Amazon "should be between worried and complacent" when it comes to anti-trust action.

"Typically, the antitrust authorities do not worry about mergers when the companies are not direct competitors," he said, referring to Amazon and Whole Foods.

"The complicating factor, however, is that Amazon is a large company that has increasing tentacles into many markets," Carrier said. "There's a sense that they are having more and more control over our lives. The reason their level of concern should be above complacency is that Washington has noticed that Amazon is getting big. Politicians from the president on down have observed Amazon is large and maybe this merger deserves a closer look."

Hottovy said the company's proposed acquisition of Whole Foods would not make it even one of the top five brick-and-mortar grocers in the United States. Beyond antitrust, Hottovy said, he is more concerned about a tax that might be levied against the internet retail giant.

"My biggest worry is more stringent taxes," he said. He notes that the company relies heavily on the U.S. Postal Service.

The vast majority of Bezos' wealth is composed of his Amazon.com shares. He owns just shy of 17 percent of the company. He also owns space rocket company Blue Origin.

"Mae West said, 'Too much of a good thing can be wonderful,' " said Michael Farr, who runs a Washington investment firm. "We presume Mr. Bezos agrees. The power and value of technology can't be overestimated. We believe Mr. Bezos will continue to set records."