Apple reported earnings Tuesday that blew past Wall Street expectations, partly on surprisingly strong sales of the iPad and Mac, sending the tech giant's stock into record territory weeks ahead of the release of its hotly anticipated new iPhone.

Analysts had wondered whether the steady stream of news reports about the company's upcoming redesign of its smartphone would hold customers back. But instead they appeared to flood its stores. Purchases of the current iPhone 7 held steady, while sales of the Mac and iPad saw an unexpected revival.

Even the Apple Watch did well, with sales up 50 percent from the same quarter last year. On a conference call with investors, Apple chief executive Tim Cook said the Apple Watch is now the best-selling smartwatch in the world "by a very wide margin."

Apple, whose stock is one of the most widely held in America, beat expectations for both revenue and profit, reporting earnings per share of $1.67 on $45.4 billion in revenue. Analysts had expected earnings of $1.57 per share on $44.9 billion in revenue.

Moments after the report, shares rose sharply in after-hours trading — more than 6 percent from its closing price of $150.05.

The firm also reported that it sold 41 million iPhones between May and June, up slightly from the same period last year when sales hit 40.4 million — a welcome reassurance for analysts who had expected a sales drop-off for iPhones as consumer wait for the next big thing.

Apple is expected to release the next models of its iconic smartphone as soon as next month. That includes a rumored 10th-anniversary edition of the iconic smartphone — an “iPhone 8" or “iPhone X” — with an all-new design and a price tag that could top $1,000.

“One decade after the initial iPhone launch, we have now surpassed 1.2 billion cumulative iPhones sold,” Cook said on the conference call with investors.

Reports based on leaks from Apple's supply chain indicate that the high-end phone will have an edge-to-edge, super-sharp OLED screen and may have a fingerprint reader embedded in the glass. Other models may keep Apple's current LCD screen. A recent leak that originated from Apple itself (through its documentation for its upcoming HomePod speaker) indicates that its next phones may also have wireless-charging, fast-charging and facial-recognition capabilities.

But a completely redesigned model of the iPhone may come with a downside: delays. OLED screens, in particular, are difficult to manufacture. Some worry Apple will be unable to keep up with demand for the phone.

Analysts were closely eyeing Apple's projections for the next quarter to try to determine how the company is thinking about its short-term future. But the company offered a rosy outlook, saying it expects to make between $49 billion and $52 billion in its next, crucial sales quarter.

Lower guidance for revenue in the fourth quarter — below $49 billion — could have indicated that Apple would delay all of its models, UBS analysts Steve Milunovich and Benjamin Wilson said in an investor's note ahead of the report.

Experts say Apple's future depends a lot on this next generation of iPhones, as the smartphone industry faces slower growth and higher competition. Sales of the iPhone have been somewhat disappointing for several quarters.

“Investor focus over the next two quarters should be on the iPhone 8 cycle,” KeyBanc Capital Markets analysts said in a note to investors earlier this month.

In a survey of potential iPhone buyers, analysts at UBS found the greatest level of interest was focused in the high-end model, noting that respondents were more interested in the “iPhone 8" than they have been in Apple's last two iPhone generations.

If it takes Apple too long to get its phones to customers, it could hurt its performance in the all-important holiday season. Apple's chief rival, Samsung, just reported record-breaking profits despite a tough year when it suffered the recall of its Note 7 smartphone. Much of Samsung's success comes from its business selling smartphone components to other manufacturers, including Apple.

Plus, Samsung is already generating good buzz about its upcoming Note 8, due to debut later this month.

Any disruption of iPhone sales could be damaging to Apple, which has counted on strong smartphone sales to weather problems in the past. Now the company faces slowing demand, including in China, the world's largest smartphone market. This quarter, China sales totaled $8 billion — slightly under expectations for $8.57 billion. Some analysts have pointed to China's market as a possible reason Apple capitulated to Chinese government demands earlier this week to stop distributing apps that iPhone users downloaded to avoid government censorship.

The app store and other Apple services, such as Apple Music, have become an increasingly important part of the company's business as it looks for ways to keep users happier with their devices for longer. Services, the second-largest segment for Apple, make up 16 percent of revenue. But the lion's share of the company's money is still tied to the iPhone, which accounts for nearly 55 percent of its sales revenue.