Wall Street couldn’t decide what it liked better Tuesday: iPhones or oil.

For a brief moment, Apple surpassed Exxon Mobil for the coveted title of most valuable company in America, a stunning turnaround for a company that a decade ago seemed irrelevant. A last-minute rally in Exxon’s stock put the oil titan back into first place, but analysts expect the battle for the crown is far from over.

Apple’s stock closed up nearly 6 percent Tuesday, at $374.01, bringing the company’s total value to $347 billion. Shares of Exxon rose 2 percent, to $71.64. It is valued at $348 billion.

That Apple could challenge Exxon is a testament to Americans’ love affair with their personal electronics. The nation’s economy may rely on fuel to transport goods and power industry, but Apple products have become the funnel for America’s entertainment, from movies to music to Facebook. It also speaks to investors’ faith in Apple chief executive Steve Jobs.

“This shows the power of consumer technology, how it has been adopted and how Apple has changed how consumers do everything,” said Michael Gartenberg, technology analyst for Gartner, a research and consulting firm.

Technology stocks have been soaring as of late, spurring some talk about a new tech bubble reminiscent of the dot-com era of the late 1990s. The stock of newly public and highly promoted companies such as Pandora and LinkedIn were some of the hardest hit in the market turmoil of the past week.

But the tech bubble hasn’t burst, analysts said, because there really was no bubble.

“It wanted to be a bubble, but it didn’t quite make it,” said Paul Saffo, managing director of foresight at Discern Analytics. “Make no mistake, investing in tech stocks is scary, but volatile markets are where the fearless make their profits.”

Apple, by contrast, has become a stalwart in the portfolios of investors. More than 70 percent of its shares are owned by institutional investors and mutual funds. In comparison, only half of Exxon’s stock is owned by such groups. Vanguard Group, which specializes in retirement portfolios, is one of Apple’s largest shareholders. TD Ameritrade said Apple was its most-traded stock last week and is often among the top 10 for its 8 million clients.

Apple pioneered the personal computer but was soon squeezed out of the market by lower-cost, high-volume manufacturers such as Hewlett-Packard and Dell. During the 1990s, Microsoft dominated the computer industry with its ubiquitous Windows operating platform and software. Apple’s products were relatively expensive, incompatible with Windows and confined to a small but fanatical niche of users.

But the tide turned in 2001 when consumers rediscovered the company after the launch of the iPod. Analysts said it was the first product to demonstrate the power of Apple’s ripple effect: The iPod not only spawned imitators such as Microsoft’s Zune but also created a new market for digital music that Apple dominates through its iTunes store.

“It’s amazing when you consider, that without Apple, the way you interact with computers would be completely different,” said Owen Linzmayer, author of “Apple Confidential 2.0.”

Apple has benefited from a phenomenon dubbed the “halo effect”: Customers who buy one product often buy another. Charlie Wolf, an analyst with investment firm Needham & Co., said that much of the growth in sales of Apple’s Mac computers is fueled by customers who own iPhones and iPads.

Wolf estimates that half of Apple’s value stems from the iPhone, with tablets and computers contributing 12 percent each. He said he believes Apple’s stock is worth $540 — a figure that would put it well ahead of Exxon. Shaw Wu, an analyst for Sterne Agee, said Apple is only starting to make inroads in Europe and China and has far more room to grow in those markets.

“We’re looking at Apple’s opportunity for the next decade, and it’s still tremendous,” Wu said.

The halo effect has also helped turn Apple’s customers into missionaries for the brand. As they acquire more Apple devices, they show off their purchases to friends, who often become customers in turn, said Leander Kahney, editor and publisher of CultofMac.com.

“There’s nothing like the zealousness of a convert,” he said. “They become absolutely fanatic.”

Analysts point to Jobs’s leadership as a key driver of Apple’s success. But concerns about his health have loomed over the company since he received a cancer diagnosis in 2003. Morningstar analyst Joseph Beaulieu wrote in a recent research note that the potential for Jobs to leave the company remains one of the biggest risks to the firm.

“We also believe Jobs’ product- and user-focused vision has been instrumental to Apple’s renaissance and has served investors incredibly well,” he wrote. If Jobs left, “we’d worry about how long Apple’s winning streak could continue.”