Share story posted fourth-quarter sales and profit that missed Wall Street expectations Tuesday, but the stock surged as much as 12 percent anyway in after-hours trading.

Depending on where you looked, the earnings report offered positive signs about Amazon’s prospects for grabbing a bigger share of the U.S. e-commerce market.

Seattle-based Amazon said its fourth-quarter sales jumped 22 percent to $21.27 billion, and its North American operating margin widened to 5 percent from 2.9 percent a year earlier.

“At the end of the day, Amazon had better than 20 percent revenue growth in a relatively ho-hum holiday quarter,” said Motley Fool analyst Jason Moser, who owns Amazon stock. “You’re not going to see that type of growth out of bigger players like Wal-Mart and Target.”

Amazon said its quarterly profit fell 45 percent from a year ago to $97 million, or 21 cents a share. Wall Street had forecast a per-share profit of 28 cents on sales of $22.26 billion.

Amazon’s stock fell 6 percent Tuesday at $260.35 before the report, then rose as much as 12 percent in extended trading. Shares eventually settled around $283.55, up 9 percent.

Investors are betting that a major spending spree over the past few years soon will deliver bottom-line results. The world’s largest Internet retailer added 20 new distribution centers last year, helping it get products to customers faster and more cheaply.

It also recently introduced a new lineup of tablets and e-readers to win more digital-media sales, and it’s rumored to be working on an Amazon smartphone.

The stock closed at a record-high of $283.99 last Friday and is trading at more than 150 times expected earnings for the year ahead.

“It’s all for the greater good,” Moser said of Amazon’s hyper investment cycle. “If you’re a believer in the secular e-commerce movement, you have to believe Amazon is going to play a tremendous part in that, because they’re shaping it as we speak.”

Amazon also seemed to ease investor concerns that U.S. sales will suffer as tax-free shopping online comes to an end. It began collecting sales taxes from customers in California and Pennsylvania last September and will add Arizona on Friday, bringing to nine the number of states where it must do so.

In an earnings call Tuesday, Chief Financial Officer Tom Szkutak did not discuss the impact of new tax requirements on Amazon’s business. Instead, he suggested that Amazon is focused on expanding its distribution network to speed up delivery times.

“We’ve rapidly increased our footprint globally. As a result of that, we’re able to carry a much broader selection closer to customers,” he said. “We’ll continue to expand our footprint over time and become closer and closer to customers.”

Szkutak said Amazon benefited from an increase in sales by third-party merchants, noting that they accounted for 39 percent of items purchased, up from 36 percent a year ago. Amazon collects a commission on third-party sales and avoids the risk of surplus stock, boosting its profit margins.

For all of 2012, Amazon’s sales rose 27 percent to $61.09 billion. Meanwhile, the company posted a full-year loss of $39 million, down from a profit of $631 million in 2011. That marks Amazon’s first annual loss since it became profitable in 2003.

Looking ahead, the Internet retailer projected first-quarter sales of between $15 billion and $16.6 billion, representing year-over-year growth of up to 26 percent. Wall Street had forecast a range between $16.3 billion and $17.3 billion.

Founder and Chief Executive Jeff Bezos said in a statement Tuesday that after five years, Amazon’s e-books business is a multibillion-dollar category, up about 70 percent last year. He contrasted that with a meager 5 percent gain in physical-book sales for December.

“We’re now seeing the transition we’ve been expecting,” Bezos said.

He was talking about the popularity of e-books and Kindle devices, but investors hope he could have just as easily been referring to bigger profits.

Amy Martinez: 206-464-2923 or