Elon Musk has overtaken Amazon. com Inc. founder Jeff Bezos as the world’s richest person, driven by a meteoric rise in the value of Tesla Inc., the electric-car maker he runs.

The bragging rights around personal wealth pit two of the tech industry’s biggest rivals in a competition that spans from the roads to outer space. Messrs. Musk and Bezos, both founders of rocket companies, have clashed over issues such as Amazon’s power over book publishing and Mr. Musk’s interest in colonizing the planet Mars. Amazon last year bought a self-driving-car startup that would compete with Tesla.

Mr. Musk’s net worth totaled around $181 billion as of market close Wednesday, up from roughly $30 billion a year ago and about $3 billion shy of Mr. Bezos’s wealth, according to the Bloomberg Billionaires Index. The value of Tesla’s shares rose almost 8% Thursday, enough for Mr. Musk to overtake Mr. Bezos in the wealth ranking. Amazon’s stock was up less than 1%. Mr. Bezos held the top spot for more than three years. Mr. Musk’s net worth rose to $188.5 billion as of 10:15 a.m., topping Mr. Bezos’s by $1.5 billion, according to Bloomberg.

“How strange,” Mr. Musk tweeted Thursday about the milestone. “Well, back to work…”

Establishing the net worth of the world’s wealthiest can be tricky, in part because many of their holdings are private. Forbes, which also tracks the assets of billionaires, ranked Mr. Musk several billion dollars behind Mr. Bezos Thursday.

Both chief executives have been huge winners during the pandemic as the shares in their companies rose sharply even as the global economy was hit by the Covid-19 disease. Amazon’s stock is up more than 60% over the past year, as people flocked to online shopping and business embraced the kind of cloud-computing services it offers.

Mr. Musk’s wealth is tied largely to Tesla, whose market capitalization increased by more than 700% in the last year as investors poured money into electric-vehicle makers. The company is now the world’s most valuable auto maker, and on Thursday also overtook Facebook Inc. by value, making the car maker the fifth-largest U.S. company. Mr. Musk, 49, owned roughly 20% of Tesla as of year-end 2019, a securities filing showed.

Mr. Musk’s wealth is tied largely to Tesla, whose market capitalization increased by more than 700% in the past year as investors poured money into electric-vehicle makers. The company is now the world’s most valuable auto maker. Mr. Musk, 49, owned roughly 20% of Tesla as of year-end 2019, a securities filing showed.

Mr. Musk also is chief executive of privately held rocket company Space Exploration Technologies Corp., or SpaceX, which joined with NASA last year to resume human space flight from American soil after years during which the U.S. relied on foreign rockets. Bloomberg valued his stake in that venture at around $19 billion.

The South Africa-born entrepreneur doesn’t accept a salary from Tesla and instead is compensated in the form of stock awards when the company achieves certain milestones tied to items including Tesla’s valuation and revenue. The stock options he became eligible for last year were worth more than $23 billion as of Wednesday, according to corporate-governance data company Equilar Inc.

Mr. Musk last year said he had moved to Texas—a state that doesn’t collect state income or capital-gains tax for individuals. SpaceX and Tesla have activities in Texas, though both maintain a large footprint in California.

Tesla, based in Silicon Valley, delivered nearly half a million vehicles globally last year and is expected to report its first full year of profit when it releases 2020 fourth-quarter earnings in a few weeks. The company in December also was included in the S&P 500 index.

Related Video

Elon Musk’s optimism and affinity for grandiose claims that may have once undercut his credibility may have now helped propel him to become the world’s second richest person. WSJ takes a look at how he managed to succeed amid the pandemic. Photo: Britta Pedersen/DDP/Zuma Press The Wall Street Journal Interactive Edition

Write to Rebecca Elliott at rebecca.elliott@wsj.com